Shared CI/CD workflows and infrastructure for 1823 Partners frontend applications.
A reusable GitHub Actions workflow that provides a standardized build-and-deploy pipeline for all 1823 frontend React applications.
- Checkout the repository
- Setup Node.js (default: 22) with GitHub Packages authentication for
@1823-partnersscoped packages - Install dependencies via
npm ci - Run unit tests (optional, enabled by default) with
npm test -- --watchAll=false --ci - Build the production bundle with
npm run build - Deploy to Azure Static Web Apps:
mainbranch pushes deploy to the preview environmentrelease-*branch pushes deploy to production- Pull requests deploy to staging (auto-cleaned on PR close)
In your app's .github/workflows/azure-static-web-apps-*.yml:
name: Azure Static Web Apps CI/CD
on:
push:
branches: [main, release-*]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [main, release-*]
jobs:
deploy:
uses: 1823-partners/infrastructure/.github/workflows/swa-deploy.yml@main
with:
azure_token_secret_name: AZURE_STATIC_WEB_APPS_API_TOKEN_YOUR_APP
secrets: inherit| Input | Required | Default | Description |
|---|---|---|---|
azure_token_secret_name |
Yes | -- | Name of the Azure SWA API token secret |
node_version |
No | "22" |
Node.js version |
run_tests |
No | true |
Whether to run unit tests before deploy |
test_args |
No | "" |
Extra arguments for npm test |
permissions:
contents: read
packages: read # For @1823-partners npm packages
pull-requests: write # For PR deployment comments- Create the Azure Static Web App resource in Azure Portal
- Copy the API token to a GitHub org secret
- Add a workflow file referencing
swa-deploy.ymlwith the token secret name - Push to
mainto trigger the first deployment