Repository navigation
Deploy the worker from CI alongside the Pages site - #47
Conversation
Until now only the Pages site deployed on push to main — the worker was manual-only, so merged worker changes silently never reached production (bit us on PR #46). Worker deploys before Pages so a fresh site never races ahead of the API it calls; the existing D1 migration baseline check still gates both. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cec442da99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Updates the production deploy workflow so the Cloudflare Worker is deployed from CI alongside the Cloudflare Pages site, ensuring Worker changes merged to main reliably reach production and reducing the chance of the site outpacing the API it depends on.
Changes:
- Adds a new “Deploy Worker” step (
wrangler deploy) ahead of the Pages deploy step. - Keeps the D1 migration baseline verification as a fail-closed gate before any deploy.
- Updates deploy-workflow commentary to reflect that production deploys run only the Node test suite here.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…pt, docs - The Worker step now uses CLOUDFLARE_WORKER_API_TOKEN, a second GitHub credential scoped to Worker script + pegma.dev route authority only — the documented contract keeps the Pages token free of Worker scope, and reusing it would have failed auth on every run while blocking Pages. - Deploy via the existing npm run worker:deploy script (single source of truth with local deploys). - docs/PROJECT_PLAN.md and worker/README.md updated: CI deploys the Worker; operator deploy is the break-glass path; step comment spells out the vars-vs-secrets contract (deploy replaces plain vars). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Until now
deploy.ymlonly deployed the Pages site on push to main — the worker was manual-only (npm run worker:deployfrom a workstation). Merged worker changes silently never reached production; this bit us on #46, where the role-store code sat undeployed while we debugged a missing bootstrap seed.Changes:
npx wrangler deploy -c worker/wrangler.jsonc), ordered before the Pages deploy so a freshly deployed site never races ahead of the API it calls.wrangler deployreplaces plain vars fromwrangler.jsonc, secrets persist — dashboard-added plain vars would be wiped, so operator config belongs in secrets.CLOUDFLARE_API_TOKENrepo secret must have Workers Scripts: Edit (account) and Workers Routes: Edit on thepegma.devzone (the worker declares a zone route). If the token was scoped to Pages only, the new step fails with an auth error until the token is updated.🤖 Generated with Claude Code