Setup staging domain for main branch merges - #89
Conversation
This change establishes clear separation between staging and production deployments using different Cloudflare Pages branches and custom domains: Changes: - Update release-web.yml to deploy to 'release' branch (not 'main') - Add preview.cambeerfestival.app to worker CORS origins - Update documentation to reflect new architecture Architecture: - Production: cambeerfestival.app (CF Pages 'release' branch, deployed on git tags) - Preview: preview.cambeerfestival.app (CF Pages 'main' branch, deployed on git main) - PR Previews: <branch>.cambeerfestival.pages.dev (CF Pages '<branch>' branch) Next step: Configure custom domains in Cloudflare Dashboard to point: - cambeerfestival.app → release branch - preview.cambeerfestival.app → main branch
There was a problem hiding this comment.
Pull request overview
This PR establishes a clear three-tier deployment architecture by separating staging from production using different Cloudflare Pages branches and custom domains. Production deployments (triggered by version tags) will now use a dedicated release branch, while the main branch serves the preview/staging environment at preview.cambeerfestival.app.
Key Changes:
- Modified production deployment workflow to use Cloudflare Pages
releasebranch instead ofmain - Added
preview.cambeerfestival.appto worker CORS allowed origins for staging environment access - Updated documentation to reflect the new three-environment architecture (development, preview, production)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/release-web.yml |
Changed production deployment target from main to release branch in Cloudflare Pages |
cloudflare-worker/worker.js |
Added https://preview.cambeerfestival.app to CORS allowed origins list |
docs/CLOUDFLARE_PAGES_SETUP.md |
Comprehensive documentation update explaining the new deployment architecture, custom domain configuration for both production and preview environments, and updated setup checklist |
README.md |
Updated deployment section to describe the three-tier architecture (production, preview/staging, development) with correct URLs and branch mappings |
Changes build-deploy.yml to deploy previews to a separate 'cambeerfestival-preview' project instead of sharing the same project. Architecture: - Project 'cambeerfestival': Production only (git tags → release branch) - Project 'cambeerfestival-preview': Staging + PRs (git main → main branch, PRs → PR branches) Each project has its own custom domain: - cambeerfestival.app → cambeerfestival project - preview.cambeerfestival.app → cambeerfestival-preview project This provides clean separation between production and staging environments while working within Cloudflare Pages' production/preview branch model.
LCOV of commit
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Cloudflare Pages uses "preview" to refer to non-production branches, which made our "preview" staging environment confusing. Renamed to "staging" for clarity: - Project: cambeerfestival-preview → cambeerfestival-staging - Domain: preview.cambeerfestival.app → staging.cambeerfestival.app - Updated CORS origins in worker - Updated all documentation This provides clearer separation between: - Production: cambeerfestival.app - Staging: staging.cambeerfestival.app - PR Previews: <branch>.cambeerfestival-staging.pages.dev
User created project as 'staging-cambeerfestival' but workflow was referencing 'cambeerfestival-staging'. Updated workflow to match the existing project name.
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://ef29be34.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
Changes PR comments to show the nicer branch-based URL: - Before: https://ef29be34.staging-cambeerfestival.pages.dev - After: https://claude-preview-domain-cicd-0.staging-cambeerfestival.pages.dev The branch-based alias is more readable and matches the branch name.
Uses the official wrangler-action output for alias URLs instead of manually constructing them. Falls back to deployment-url if alias is not available. This is more reliable and handles branch name encoding automatically.
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://claude-preview-domain-cicd-0.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
This pull request reorganizes the deployment architecture for the app, introducing a clear separation between production and staging environments using two distinct Cloudflare Pages projects. It updates documentation, workflow files, and CORS configuration to reflect these changes, ensuring easier management and more predictable deployments for production, staging, and PR previews.
Deployment Architecture Updates:
cambeerfestivalfor production (branchrelease) andcambeerfestival-stagingfor staging and PR previews (branchmainand PR branches). This is reflected in both workflow files and documentation. [1] [2] [3] [4] [5]Documentation Improvements:
README.mdanddocs/CLOUDFLARE_PAGES_SETUP.mdare updated to clarify the new deployment environments, custom domains, and setup steps for both projects. The summary checklist is expanded to cover both production and staging setups. [1] [2] [3]CORS Configuration:
https://staging.cambeerfestival.app) to support API calls from all environments without CORS errors.Preview and Staging URLs:
<branch>.cambeerfestival-staging.pages.dev. Staging is served athttps://staging.cambeerfestival.app. [1] [2]Workflow Changes:
releasebranch and staging/PR previews to themainbranch of the appropriate Cloudflare Pages project. [1] [2]