Deploy SWA to staging environment#228
Merged
Merged
Conversation
- 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>
|
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>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-228.westus2.7.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-228.westus2.7.azurestaticapps.net |
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.
Description
Deploys the SWA to a staging environment when opening a PR
Type of Change
Changes Made
Testing
Screenshots (if applicable)
Checklist