chore: updated build and deploy flow
7e911cc9
3 file(s) · +12 −8
| 1 | + | { |
|
| 2 | + | "siteId": "e4400933-efdd-4788-80d9-6a28872c3dc7", |
|
| 3 | + | "domain": "norns", |
|
| 4 | + | "buildCommand": "bun run build:site", |
|
| 5 | + | "buildDir": "site-dist" |
|
| 6 | + | } |
| 13 | 13 | "scripts": { |
|
| 14 | 14 | "build": "bun build src/index.ts --outdir dist --target node && bun run build:components", |
|
| 15 | 15 | "build:components": "bun scripts/build-components.ts", |
|
| 16 | - | "deploy:site": "bun scripts/deploy-site.ts", |
|
| 16 | + | "build:site": "bun scripts/build-site", |
|
| 17 | 17 | "dev": "bun site/index.html --console" |
|
| 18 | 18 | }, |
|
| 19 | 19 | "keywords": [ |
| 1 | 1 | import { $ } from "bun"; |
|
| 2 | 2 | ||
| 3 | + | // Clean up dist |
|
| 4 | + | await $`rm -rf site-dist`; |
|
| 3 | 5 | // Create new dist |
|
| 4 | 6 | await $`cp -r site site-dist`; |
|
| 5 | 7 | // Compile tailwindcss |
|
| 6 | 8 | await $`bunx @tailwindcss/cli -i ./site/input.css -o ./site-dist/output.css `; |
|
| 9 | + | // Build components |
|
| 10 | + | await $`bun run build`; |
|
| 7 | 11 | // Copy components over |
|
| 8 | - | await $`cp -r src/components site-dist/components`; |
|
| 12 | + | await $`cp -r dist/components site-dist/components`; |
|
| 9 | 13 | ||
| 10 | 14 | // Read index file |
|
| 11 | 15 | const htmlContent = await Bun.file("site-dist/index.html").text(); |
|
| 25 | 29 | ); |
|
| 26 | 30 | // Write file |
|
| 27 | 31 | await Bun.write("site-dist/index.html", updatedHtml); |
|
| 28 | - | ||
| 29 | - | // Run orbiter update |
|
| 30 | - | await $`orbiter update -d norns site-dist`; |
|
| 31 | - | ||
| 32 | - | // Clean up dist |
|
| 33 | - | await $`rm -rf site-dist`; |
|