Skip to content

ci: deploy to Azure Static Web Apps via GitHub Actions (EXP-1610) - #73

Closed
pmckinney-codat wants to merge 1 commit into
mainfrom
EXP-1610-github-actions-swa
Closed

pmckinney-codat wants to merge 1 commit into
mainfrom
EXP-1610-github-actions-swa

Conversation

@pmckinney-codat

@pmckinney-codat pmckinney-codat commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

EXP-1610 — migrate legal.codat.io off Vercel to Azure.

What

  • GitHub Actions workflow (.github/workflows/deploy.yml): build once, then
    • PR → deploy to an Azure Static Web Apps preview environment (URL commented on the PR; environment torn down when the PR closes)
    • push to main → deploy to production, gated behind the production GitHub environment (approval required)
  • static/staticwebapp.config.json: serves Docusaurus' 404.html for not-found routes.

Decisions (per EXP-1595)

  • SWA for both prod and PR previews (single toolchain; the epic's leading recommendation)
  • Free SKU — this site is tiny; easy bump to Standard later if an SLA is ever needed. Free allows 3 concurrent PR preview environments.
  • Single SWA — PR previews act as the pre-prod check, no separate integration deployment
  • ADO npm feed kept — CI authenticates with NPM_TOKEN, consistent with what help.codat.io will need

Companion PRs

  • codat-internal/infrastructure-as-code#1445 — staticWebApps IaC stack (provisions the SWA)
  • codat-internal/infrastructure-as-code#1443 — Vercel decommission (merge last, after cutover)

Before this can merge

  • SWA provisioned via codat-internal/infrastructure-as-code#1445
  • Repo secret AZURE_STATIC_WEB_APPS_API_TOKEN set from the SWA deployment token
  • Repo secret NPM_TOKEN set (base64-encoded ADO PAT, same value the Vercel build used)
  • production environment created in repo Settings → Environments with required reviewers (this is the approval gate)

DNS cutover and Vercel decommission happen after this merges and prod is verified on the SWA default hostname.

Verification

  • npm run build passes locally on Node 22 (matches workflow)
  • Build output contains 404.html and staticwebapp.config.json at the root

🤖 Generated with Claude Code

Adds a GitHub Actions pipeline replacing Vercel hosting: build once,
deploy PR previews to SWA preview environments, deploy main to
production behind a GitHub environment approval gate, and clean up
preview environments when PRs close.

staticwebapp.config.json serves Docusaurus' 404.html for not-found
routes on SWA.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
legal Ready Ready Preview, Comment Jul 21, 2026 1:33pm

Request Review

@pmckinney-codat

pmckinney-codat commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Closing in favour of #74 — we're deploying legal to GitHub Pages (mirroring the engineering-blog setup) instead of Azure SWA. Change of approach recorded on EXP-1610; infrastructure-as-code#1445 is no longer needed for legal.

— Posted by Claude on Phil's behalf

This branch was successfully deployed

1 active deployment
Preview — 8b91cd69 Deployed Jul 21, 2026 by vercel[bot]
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