Skip to content

Setup staging domain for main branch merges - #89

Merged
richardthe3rd merged 6 commits into
mainfrom
claude/preview-domain-cicd-01NfxMDkhnoKRY97S2r5tX2U
Dec 4, 2025
Merged

Setup staging domain for main branch merges#89
richardthe3rd merged 6 commits into
mainfrom
claude/preview-domain-cicd-01NfxMDkhnoKRY97S2r5tX2U

Conversation

@richardthe3rd

@richardthe3rd richardthe3rd commented Dec 2, 2025

Copy link
Copy Markdown
Owner

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:

  • The app now uses two separate Cloudflare Pages projects: cambeerfestival for production (branch release) and cambeerfestival-staging for staging and PR previews (branch main and PR branches). This is reflected in both workflow files and documentation. [1] [2] [3] [4] [5]

Documentation Improvements:

  • The README.md and docs/CLOUDFLARE_PAGES_SETUP.md are 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:

  • The Cloudflare Worker’s allowed origins now include the new staging domain (https://staging.cambeerfestival.app) to support API calls from all environments without CORS errors.

Preview and Staging URLs:

  • PR previews are now deployed to the staging project, with unique URLs for each PR in the format <branch>.cambeerfestival-staging.pages.dev. Staging is served at https://staging.cambeerfestival.app. [1] [2]

Workflow Changes:

  • Workflow steps are updated to deploy production to the release branch and staging/PR previews to the main branch of the appropriate Cloudflare Pages project. [1] [2]

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
Copilot AI review requested due to automatic review settings December 2, 2025 21:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 release branch instead of main
  • Added preview.cambeerfestival.app to 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.
@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

LCOV of commit 9fa42f0 during Flutter App CI/CD #359

Summary coverage rate:
  lines......: 57.7% (1170 of 2027 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@codecov

codecov Bot commented Dec 3, 2025

Copy link
Copy Markdown

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
@richardthe3rd
richardthe3rd requested a review from Copilot December 3, 2025 08:17
@richardthe3rd richardthe3rd changed the title Setup preview domain for main branch merges Setup staging domain for main branch merges Dec 3, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

User created project as 'staging-cambeerfestival' but workflow
was referencing 'cambeerfestival-staging'. Updated workflow to
match the existing project name.
@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your 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.
@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your 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.

@richardthe3rd
richardthe3rd merged commit d178f12 into main Dec 4, 2025
14 checks passed
@richardthe3rd
richardthe3rd deleted the claude/preview-domain-cicd-01NfxMDkhnoKRY97S2r5tX2U branch December 4, 2025 17:03
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.

3 participants