Static Web Apps
Overview
Section titled “Overview”The solution uses Azure Static Web Apps (SWA) to host the fully-static frontend applications and documentation site. SWA provides global CDN distribution, custom domain and TLS management, and built-in preview environment support for pull requests.
SWA Inventory
Section titled “SWA Inventory”| SWA Resource | Surface | Environment | Resource Group |
|---|---|---|---|
swa-agent-test | Agent App | Test | rg-application-test |
swa-agent-prod | Agent App | Production | rg-application |
swa-customer-test | Customer App | Test | rg-application-test |
swa-customer-prod | Customer App | Production | rg-application |
swa-maxconf-docs | Docs Site | Single environment | rg-shared-resources |
Deployment Model
Section titled “Deployment Model”SWA deployments use deployment tokens - API tokens scoped to a specific Static Web App that authorize uploads without requiring full Azure RBAC credentials.
- Each SWA has its own deployment token stored as a GitHub Actions environment secret (e.g.,
SWA_AGENT_APP_DEPLOYMENT_TOKEN). - Tokens are passed to the
Azure/static-web-apps-deploy@v1action. - No build step is required for
agent-appandcustomer-app- they are plain static files deployed fromsrc/directly. - The docs site requires a build step (
pnpm nx run docs:build) before deployment.
Preview Environments
Section titled “Preview Environments”When a pull request is opened against main that modifies an SWA surface, a preview environment is deployed automatically. This provides a temporary staging URL for reviewing changes before merge.
- Preview environments are created by the test workflow’s
deploy-previewjob. - When the PR is closed (merged or abandoned), a
close_pull_requestjob runs to clean up the preview environment. - The preview URL is posted as a comment on the PR by the SWA deploy action.
Custom Domains
Section titled “Custom Domains”Static Web Apps support custom domain binding with automatic TLS certificate provisioning. Domain configuration is managed in the Azure portal under each SWA’s Custom domains settings.
Routing
Section titled “Routing”Both agent-app and customer-app include a staticwebapp.config.json file that controls SWA routing behavior (navigation fallback, response headers, etc.).