Publish 2026-05-29T09:06:47Z from c3eff47 #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cloudflare Worker deploy workflow - Path B (opt-in). | |
| # | |
| # Draft. Lives under .plans/deploy-modes/ until promoted. Replaces the current | |
| # .github/workflows/deploy.yml on promotion. | |
| # | |
| # Default behaviour after promotion: | |
| # - Path B users who clicked the deploy button get the Worker created by | |
| # Cloudflare directly. The repo is NOT the source of redeploys. | |
| # - This workflow exists for users who DO want push-to-main redeploys for | |
| # their Worker, e.g. when shipping SPA updates or new bundle defaults. | |
| # | |
| # Gating via repo Actions variable DEPLOY_MODE: | |
| # unset or 'pages' -> skipped (pages.yml runs instead) | |
| # 'worker' -> this workflow runs, wrangler deploys on every push | |
| # | |
| # Required repo secrets when DEPLOY_MODE='worker': | |
| # CLOUDFLARE_API_TOKEN scoped Workers Scripts: Edit + (R2 + KV: Edit for first run) | |
| # CLOUDFLARE_ACCOUNT_ID account that owns the Worker | |
| # | |
| # Runtime: Bun everywhere (matches repo convention; bun.lock at root). | |
| name: Deploy Worker | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| if: vars.DEPLOY_MODE == 'worker' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install worker dependencies | |
| run: bun install --frozen-lockfile | |
| working-directory: worker | |
| - name: Build asset manifest | |
| run: bun run scripts/build-manifest.ts | |
| - name: Deploy Worker (uploads ../ via Workers Assets) | |
| run: bunx wrangler deploy | |
| working-directory: worker | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |