Skip to content

ci: deploy to Cloudflare on merge to master - #17

Open
didagu wants to merge 1 commit into
masterfrom
ci/deploy-on-merge
Open

didagu wants to merge 1 commit into
masterfrom
ci/deploy-on-merge

Conversation

@didagu

@didagu didagu commented Oct 10, 2026

Copy link
Copy Markdown
Owner

First item from Next steps: deploy automatically on every merge to master.

What it does

  • New deploy job in ci.yml. It runs only on pushes to master, after check passes:
    1. db:migrate:remote applies any new D1 migrations;
    2. run deploy builds apps/web and runs wrangler deploy;
    3. a smoke test calls /api/health, the page and one /api/check on the live URL.
  • It deploys through the GitHub production environment with URL https://cleanhashtags.didagou.workers.dev, so each successful deploy shows View deployment on the commit and PR and appears under Deployments.
  • Deploys never overlap (concurrency: deploy-production), and a run on master is no longer cancelled by a newer push. PR runs are still cancelled when superseded.
  • The README has a new Automatic deploys section, and the roadmap item is ticked.

Needed before merging

  • Repo variable CLOUDFLARE_ACCOUNT_ID: already set.
  • Repo secret CLOUDFLARE_API_TOKEN: the owner must add it. The token needs Workers Scripts: Edit and D1: Edit. Without it the deploy job fails on the first merge, and nothing else breaks.

Testing

  • pnpm lint passes, and Prettier parses the workflow.
  • The deploy job can't run on a PR. The first real run is the merge of this PR itself, which deploys the same code that is already live.

🤖 Generated with Claude Code

Adds a deploy job that runs after CI on pushes to master: applies remote
D1 migrations, builds and deploys the Worker, then smoke-tests the live
URL. It uses a GitHub production environment so each deploy gets a
"View deployment" link. PR runs are still cancelled when superseded;
master runs are not, so deploys never stop halfway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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