CI/CD Runbook
Owner: Engineering Last reviewed: 2026-Q2
This runbook explains how Azure DevOps builds and deploys the repo.
Pipeline Entry Points
azuredevops/pipelines/api.yamlbuilds and deploys the backend.azuredevops/pipelines/frontend.yamlbuilds and deploys the frontend.
Both pipelines trigger on dev, showcase, and main and are path-filtered to their app directories.
Branch To Environment Mapping
| Branch | Variable group | Tag | Azure subscription | Resource group |
|---|---|---|---|---|
dev | dev | dev | workopti-dev | dev-hsbm-rg |
showcase | showcase | showcase | workopti-dev | dev-hsbm-rg |
main | prod | prod | workopti-prod | prod-gslm-rg |
| Pull request | showcase | validation only | n/a | n/a |
Backend Flow
validate_changeschecks for changes underbackend/py/.templates/stages/docker-build.yamlbuilds the backend image frombackend.- Image repository is
workopti; API tag ispy. - Images are pushed to
workopti.azurecr.iothrough theworkopti-acrservice connection. - Non-PR builds deploy through
templates/stages/deploy-api.yaml.
Frontend Flow
- Pull requests install Node 22, run
npm ci, then runnpm run build. - Non-PR builds use
templates/stages/docker-frontend.yaml. - Image repository is
workopti-frontend. - Deploy targets are environment-specific Azure Web Apps.
- Frontend deploys purge the configured Front Door/CDN endpoint and profile.
Promotion
- Normal path: merge to
dev, validate, promote toshowcase, then promote tomainwhen prod is enabled. - Promotion should include a short changelog, migration note, and manual validation note.
- API and frontend can deploy independently, but API contract changes must keep OpenAPI/Orval compatibility in mind.
Rollback
- Roll back by redeploying the previous known-good image tag for the affected app and environment.
- If rollback follows a DB migration, check
database-operations.mdbefore downgrading or re-running migrations. - After rollback, verify health endpoints, login, board load, and the affected workflow.
Required Checks Before Deploy
- Backend: route/service tests for changed behavior, migrations reviewed, env vars present.
- Frontend:
npm run build,npm run lint, generated clients refreshed when API changed. - Security-sensitive changes: second approval per
how-we-work/code-review.md. - Docs updated when architecture, operations, API contract, or security behavior changes.
Failure Triage
- Build failure: check dependency install, TypeScript/Python errors, Dockerfile changes, and path filters.
- Push failure: check ACR service connection and image repository/tag.
- Deploy failure: check Azure subscription, app service name, resource group, and container startup logs.
- Frontend stale assets: check CDN purge stage and browser cache behavior.