app_prismio Deploy Runbook¶
This is an operator-first checklist for building, promoting, and rolling back app_prismio.
Quick model¶
- Build once: produce an immutable image tagged with a full Git SHA.
- Promote by redeploying the same SHA to each environment.
- Roll back by redeploying a previously known-good SHA.
Prerequisites¶
- You can run GitHub Actions workflows in this repository.
- GitHub environment configuration is present for dev, staging, and prod:
- Required environment variable: DEPLOY_PATH
- Required environment variable: APP_ENV_FILE
- Repository secrets are configured for deploy workflow:
- DEPLOY_SSH_PRIVATE_KEY
- DEPLOY_HOST
- DEPLOY_USER
- GHCR_USERNAME
- GHCR_TOKEN
A) Build immutable image¶
- Merge changes to main or master (or run the build workflow manually).
- Open workflow: Build app_prismio Images.
- Wait for success.
- Capture the image tag from logs. The tag is the full commit SHA.
Expected artifact format:
- ghcr.io/
/api:
B) Deploy to dev¶
- Open workflow: Deploy app_prismio.
- Click Run workflow.
- Set inputs:
- environment: dev
- image_tag:
- Run.
- Confirm workflow success.
What the workflow does:
- Verifies image exists in GHCR.
- Syncs deploy compose files to remote host.
- Pulls app and migrate images.
- Runs one-off migrations:
- python manage.py migrate --noinput
- Starts app container.
- Waits for container health check.
C) Promote to staging, then prod¶
Use exactly the same SHA from dev.
- Run Deploy app_prismio with:
- environment: staging
- image_tag:
- Validate staging.
- Run Deploy app_prismio with:
- environment: prod
- image_tag:
- Validate prod.
Rule: do not rebuild between environments. Promotion is redeploying the same artifact.
D) Rollback¶
- Identify the previous known-good SHA.
- Run Deploy app_prismio with:
- environment: target environment to recover
- image_tag:
- Confirm workflow success and app health.
Rollback is a redeploy of an older immutable tag.
E) Post-deploy smoke checks¶
Run after each environment deploy:
- Confirm workflow is green.
- Confirm app is reachable.
- Confirm login and one critical user flow.
- Confirm no migration errors in logs.
- Confirm no error spike in monitoring.
F) Local simulation (optional)¶
From repository root:
APP_IMAGE=ghcr.io/your-org/api:
This exercises pull + migrate + rollout with the deploy compose overlay locally.
G) Failure triage¶
If deploy fails, use this order:
- Image not found:
- Confirm SHA exists in Build workflow output.
- SSH or host sync failure:
- Confirm DEPLOY_HOST, DEPLOY_USER, DEPLOY_SSH_PRIVATE_KEY.
- Migration failure:
- Inspect migrate container logs.
- Health check timeout/unhealthy:
- Inspect app container logs and /healthz dependencies.
References¶
- .github/workflows/build-api.yaml
- .github/workflows/deploy-api.yaml
- .github/workflows/deploy-sites.yml
- .github/workflows/deploy-marketing-preview.yml
- infra/docker/compose/compose.yaml
- infra/docker/compose/services/api.yaml
- infra/docker/compose/services/postgres.yaml
- tools/docker/Makefile
H) Sites deploys (marketing and docs)¶
The docs and marketing Cloudflare Pages deployments are consolidated in:
.github/workflows/deploy-sites.yml
Trigger behavior:
- The workflow runs only for pull requests targeting
mainwhen the PR is merged.
Job behavior (path-gated):
deploy-marketingruns only when matching marketing files change:apps/api/prismio/marketing/templates/marketing/pages/**apps/api/prismio/templates/common/components/**apps/api/prismio/static/**apps/api/prismio/marketing/urls.pyapps/api/prismio/marketing/views.pyapps/api/prismio/marketing/management/commands/export_guest_site.py.github/workflows/deploy-sites.yml.github/workflows/deploy-marketing-preview.ymldeploy-docsruns only when matching docs files change:docs/**apps/api/docs/**tools/docs/**.github/workflows/deploy-sites.yml
Marketing preview deploy¶
Preview deploys are manual-only via:
.github/workflows/deploy-marketing-preview.yml
This workflow is workflow_dispatch only, so it never runs automatically from PR or push events.
Run steps:
- Open repository Actions.
- Choose Deploy Marketing Preview.
- Click Run workflow.