ci: auto-deploy to Cloudflare on merge to main#173
Merged
Conversation
Uncomment the push: trigger so merges to main deploy automatically (migrate -> proxy -> mock -> web), matching a Vercel-style flow while keeping the manual workflow_dispatch button. Also fix the D1 migrate gate: it was if: inputs.migrate, which is empty on push events, so auto-deploys would silently skip migrations. Now runs on every push and on manual dispatch when the toggle is on.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe deployment workflow now triggers on pushes to ChangesDeployment workflow auto-run
Sequence Diagram(s)sequenceDiagram
participant GitHubActions as "GitHub Actions"
participant DeployWorkflow as "deploy.yml"
participant D1Step as "Apply D1 migrations (remote)"
participant ProxyWorker as "proxy worker"
participant MockWorker as "mock worker"
participant OpenNextWeb as "web via OpenNext"
GitHubActions->>DeployWorkflow: push to main or workflow_dispatch
DeployWorkflow->>D1Step: run when trigger and migrate condition match
DeployWorkflow->>ProxyWorker: deploy
DeployWorkflow->>MockWorker: deploy
DeployWorkflow->>OpenNextWeb: deploy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enable automatic production deploys. Merging to
mainnow runs the existing deploy.yml (migrate → proxy → mock → web) — the closest thing to a Vercel-style flow on Cloudflare. The manualworkflow_dispatchbutton stays.Why
The playground (#172) is merged to
mainbut never reached production:deploy.ymlwas manual-trigger-only and had never run (repo secrets weren't set). Secrets are now configured (CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID, verified for D1 + Workers access). This PR flips on the auto-trigger so the merge ships everything currently onmain.Bug fix included
The D1 migrate step was gated on
if: ${{ inputs.migrate }}, which is empty onpushevents → auto-deploys would silently skip migrations. Now:if: ${{ github.event_name == 'push' || inputs.migrate }}.Security (open-source repo)
${{ secrets.* }}— never hardcoded.deploy.ymltriggers only on push-to-main / manual dispatch (fork PRs can't reach it);ci.ymluses no secrets, so fork PRs can't exfiltrate..dev.vars/.envtracked; gitignore confirmed.Merging this triggers the first real production deploy.
Summary by CodeRabbit