Skip to content

feat: add automated deployment workflow for prod branch#157

Merged
mahata merged 1 commit intomainfrom
opencode/witty-lagoon
Mar 30, 2026
Merged

feat: add automated deployment workflow for prod branch#157
mahata merged 1 commit intomainfrom
opencode/witty-lagoon

Conversation

@mahata
Copy link
Copy Markdown
Owner

@mahata mahata commented Mar 30, 2026

Summary

  • Add .github/workflows/deploy.yml — automated deployment pipeline triggered on push to prod branch
  • Pipeline runs unit tests + E2E tests as gates, then applies D1 migrations and deploys to Cloudflare Workers
  • Update README.md with automated deployment documentation and CLOUDFLARE_API_TOKEN setup instructions

Deployment Flow

main (development) ──merge──▶ prod ──push──▶ test ┐
                                             e2e  ┤──▶ deploy (Cloudflare Workers)
                                                  ┘

Required Secret

CLOUDFLARE_API_TOKEN must be set as a GitHub repository secret with Workers Scripts: Edit, D1: Edit, and Account Settings: Read permissions.

Add .github/workflows/deploy.yml that triggers on push to the prod
branch. The pipeline runs unit tests, E2E tests, and lint as gates
before applying D1 migrations and deploying to Cloudflare Workers.

Update README.md with automated deployment documentation and
CLOUDFLARE_API_TOKEN setup instructions.
Copilot AI review requested due to automatic review settings March 30, 2026 01:30
@mahata mahata merged commit aec96f3 into main Mar 30, 2026
5 checks passed
@mahata mahata deleted the opencode/witty-lagoon branch March 30, 2026 01:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a production CI/CD pipeline that deploys the Cloudflare Worker automatically when the prod branch is updated, and documents the new flow for operators.

Changes:

  • Introduces .github/workflows/deploy.yml triggered by pushes to prod, gating deployment on unit + E2E tests.
  • Runs production D1 migrations and deploys via pnpm db:migrate:prod and pnpm run deploy.
  • Updates README.md with CI/CD deployment instructions and required CLOUDFLARE_API_TOKEN setup.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
README.md Documents the new automated prod deployment workflow and required secrets.
.github/workflows/deploy.yml Adds a new GitHub Actions workflow to test, run E2E, migrate D1, and deploy on prod pushes.

Comment on lines +3 to +6
on:
push:
branches: [prod]

Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a concurrency group for this workflow (or at least for the deploy job) to prevent overlapping production deploys. Without concurrency/cancel-in-progress, two quick pushes to prod can run two deploy jobs in parallel and the older run may finish last, effectively redeploying an older commit after a newer one.

Copilot uses AI. Check for mistakes.
retention-days: 30

deploy:
needs: [test, e2e]
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deploy job uses a repo-level secret (CLOUDFLARE_API_TOKEN) and runs on every push to prod. If you intend to gate production deployments, consider using a GitHub Actions environment: production on the deploy job so you can enforce required reviewers / deployment protection rules and scope secrets to that environment.

Suggested change
needs: [test, e2e]
needs: [test, e2e]
environment: production

Copilot uses AI. Check for mistakes.
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.

2 participants