Skip to content

Deploy SWA to staging environment#228

Merged
xenobiasoft merged 4 commits into
mainfrom
feature/staging-swa-deployment
Apr 17, 2026
Merged

Deploy SWA to staging environment#228
xenobiasoft merged 4 commits into
mainfrom
feature/staging-swa-deployment

Conversation

@xenobiasoft

Copy link
Copy Markdown
Owner

Description

Deploys the SWA to a staging environment when opening a PR

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

Testing

  • I have tested these changes locally
  • All existing tests pass
  • I have added new tests (if applicable)

Screenshots (if applicable)

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have updated the documentation (if necessary)

Shannon Stewart and others added 2 commits April 17, 2026 06:44
- Add .github/workflows/staging.yml to build and deploy all services to
  the staging environment on push to the staging branch or manual dispatch
- Add enableCustomDomain/customDomainName params to staticwebapp.bicep so
  the SWA can bind a custom domain with automatic managed SSL
- Wire the new SWA params through main.bicep (swaCustomDomainName /
  enableSwaCustomDomain) with safe defaults so prod.bicepparam is unaffected
- Set staging.bicepparam to bind beta-sudoku.xenobiasoft.com to the
  staging SWA; DNS must be configured before running the deployment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The staging workflow now deploys to the built-in "staging" deployment
environment of the existing production SWA (swa-sudoku-xenobiasoft-prod)
using the deployment_environment parameter — no separate SWA or infra
stack is created for staging.

Changes:
- staging.yml: strip down to frontend-only build/test/deploy; trigger on
  PRs to main, pushes to staging branch, and workflow_dispatch; add a
  job summary step that prints the staging and custom-domain URLs
- staticwebapp.bicep: replace top-level custom domain with an environment-
  scoped domain using Microsoft.Web/staticSites/builds/customDomains so
  the domain binds to the "staging" slot, not production
- main.bicep: update param descriptions to reflect SWA environment scope
- staging.bicepparam: point staticWebAppName at the prod SWA, set domain
  to sudoku-beta.xenobiasoft.com, leave enableSwaCustomDomain=false until
  DNS is configured and the staging environment has been deployed once

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-228.westus2.7.azurestaticapps.net

The custom domain belongs on the production SWA slot (the React app's
main deployment), not the staging slot. Staging environments use their
auto-generated SWA URLs.

- staticwebapp.bicep: use top-level Microsoft.Web/staticSites/customDomains
  (production binding) instead of the builds/customDomains child resource
- prod.bicepparam: add swaCustomDomainName=sudoku-beta.xenobiasoft.com and
  enableSwaCustomDomain=true
- staging.bicepparam: remove custom domain params; note that the staging
  environment slot uses the default SWA URL
- main.bicep: correct param descriptions to reflect production binding

DNS prerequisite: add a CNAME for sudoku-beta.xenobiasoft.com pointing to
the SWA default hostname before running the prod infra deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-228.westus2.7.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-228.westus2.7.azurestaticapps.net

@xenobiasoft xenobiasoft merged commit 0c5c275 into main Apr 17, 2026
9 checks passed
@xenobiasoft xenobiasoft deleted the feature/staging-swa-deployment branch April 17, 2026 13:14
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