Skip to content

Deploy

CI/CD: .github/workflows/deploy.yml runs on push to main: test → migrate staging → deploy staging → manual approval → migrate prod → deploy prod.

  • Repo secrets: RAILWAY_TOKEN, STAGING_DATABASE_URL, PROD_DATABASE_URL.
  • GitHub production environment protected with required reviewers (the approval gate).
  1. Merge to main. CI runs (lint + tests + web/marketing build).
  2. Migrations apply to staging, then services deploy to staging.
  3. Smoke-check staging: GET /health ok; log in; open a device; pull a report.
  4. Approve the production environment in the workflow run.
  5. Migrations apply to prod, then services deploy.
  6. Verify prod GET /health + a real user flow.
  • Forward-compatible: deploy code that tolerates both old and new schema, or migrate before deploy (the pipeline migrates first). Avoid destructive migrations in the same release as the code that still reads the old shape.
  • Migrations are Alembic (backend/app/db/migrations); alembic upgrade head.

rollback.md.