Skip to content

ci: gate production deploy on the test suite - #3

Merged
chengmarc merged 1 commit into
mainfrom
ci/deploy-from-ci
Aug 13, 2026
Merged

chengmarc merged 1 commit into
mainfrom
ci/deploy-from-ci

Conversation

@chengmarc

Copy link
Copy Markdown
Collaborator

Makes the validation suite a hard gate on production by moving deploys into CI, replacing Cloudflare's ungated Git auto-deploy.

What

  • Adds a deploy job to .github/workflows/ci.yml that runs only on pushes to main and only after the test job passes (needs: test). It builds and runs npx wrangler deploy.
  • On PRs, only test runs — no deploy.
  • README Deployment section updated.

⚠️ Required before merging (manual, on your side)

This PR's test job is safe to run now, but the first push to main after merge will try to deploy. Do these first or that deploy fails / double-deploys:

  1. Create a Cloudflare API token with Workers Scripts:Edit (Account) permission.
  2. Add repo secrets (Settings → Secrets and variables → Actions):
    • CLOUDFLARE_API_TOKEN
    • CLOUDFLARE_ACCOUNT_ID
  3. Disable Cloudflare's Git auto-deploy for this Worker (Cloudflare dashboard → the Worker → Builds/Git integration) so CI is the only deploy path.

Once those are done, merging this PR makes every future change to main deploy only through green CI.

🤖 Generated with Claude Code

Add a `deploy` job that runs only on pushes to main and only after `test`
passes, building and running `wrangler deploy`. This makes the validation
suite a hard gate on production — broken code cannot reach doubletrends.com —
replacing Cloudflare's ungated Git auto-deploy.

Requires repo secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, and
Cloudflare's Git auto-deploy must be disabled so CI is the only deploy path.
README Deployment section updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
doubletrends 95d7310 Aug 13 2026, 10:07 AM

@chengmarc
chengmarc merged commit d0e3bfb into main Aug 13, 2026
3 checks passed
@chengmarc
chengmarc deleted the ci/deploy-from-ci branch August 13, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant