Add Cloudflare Pages deploy script
This commit is contained in:
parent
a2a6dee025
commit
d8af980f7d
|
|
@ -65,6 +65,26 @@ cd site/decodal-site
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Deploy the static site to Cloudflare Pages with Wrangler direct upload:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd site/decodal-site
|
||||||
|
npm run deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
The deploy script runs `npm run build` and then uploads `dist/` to the Pages project named `decodal-site`.
|
||||||
|
Use `CLOUDFLARE_PROJECT_NAME` when deploying to a differently named Pages project.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
CLOUDFLARE_PROJECT_NAME=my-pages-project npm run deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
If the committed WASM package must be regenerated before deploy, use:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run deploy:wasm
|
||||||
|
```
|
||||||
|
|
||||||
## Tree-sitter grammar
|
## Tree-sitter grammar
|
||||||
|
|
||||||
The Tree-sitter grammar is kept in:
|
The Tree-sitter grammar is kept in:
|
||||||
|
|
|
||||||
1459
site/decodal-site/package-lock.json
generated
1459
site/decodal-site/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -7,11 +7,16 @@
|
||||||
"dev": "astro dev --host 0.0.0.0",
|
"dev": "astro dev --host 0.0.0.0",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview --host 0.0.0.0",
|
"preview": "astro preview --host 0.0.0.0",
|
||||||
"build:wasm": "wasm-pack build ../../crates/decodal-wasm --target web --out-dir ../../site/decodal-site/src/wasm --release"
|
"build:wasm": "wasm-pack build ../../crates/decodal-wasm --target web --out-dir ../../site/decodal-site/src/wasm --release",
|
||||||
|
"deploy": "npm run build && wrangler pages deploy dist --project-name ${CLOUDFLARE_PROJECT_NAME:-decodal-site}",
|
||||||
|
"deploy:wasm": "npm run build:wasm && npm run deploy"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.4",
|
"@astrojs/check": "^0.9.4",
|
||||||
"astro": "^4.16.18",
|
"astro": "^4.16.18",
|
||||||
"marked": "^12.0.2"
|
"marked": "^12.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"wrangler": "^4.104.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user