Automate asset browser deployment

This commit is contained in:
Matt Isenhower
2026-08-30 20:04:06 -07:00
parent 8d157963f0
commit 57e46c3121
3 changed files with 10 additions and 2 deletions

View File

@@ -25,3 +25,4 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run assets-browser:deploy:dry-run

View File

@@ -6,7 +6,8 @@
"build": "vite build",
"assets-browser:dev": "wrangler dev --local --var LOCAL_DEVELOPMENT:true --persist-to .wrangler/state --cwd workers/assets-directory-browser",
"assets-browser:test": "vitest run --config workers/assets-directory-browser/vitest.config.mjs",
"assets-browser:dry-run": "wrangler deploy --dry-run --cwd workers/assets-directory-browser",
"assets-browser:deploy": "wrangler deploy --cwd workers/assets-directory-browser",
"assets-browser:deploy:dry-run": "wrangler deploy --dry-run --cwd workers/assets-directory-browser",
"preview": "vite preview --port 5050",
"lint": "eslint .",
"lint-fix": "npm run lint -- --fix",

View File

@@ -64,9 +64,15 @@ connects to the production bucket.
```sh
npm run assets-browser:test
npm run assets-browser:dry-run
npm run assets-browser:deploy:dry-run
```
`npm run assets-browser:deploy` performs the production deployment. Production
deployments are handled by Cloudflare Workers Builds, configured from the
repository root with `main` as the production branch,
`npm run assets-browser:test` as the build command, and
`npm run assets-browser:deploy` as the deploy command.
## Production rollout
Do not create the URL Rewrite Rule until the Worker route has been deployed and