Deploy setup — manual, human-only checklist
Brouillon : cette page n'a pas encore été relue et peut être incomplète ou inexacte.
These steps require the GitHub UI, the DigitalOcean console, or org-admin rights
and cannot be performed by CI. Do them in order. See deploy-architecture.md
for the model. Names in CODE are referenced by the workflows — keep them exact
or update the workflow vars/secrets to match.
0. Conventions used by the workflows
Section intitulée « 0. Conventions used by the workflows »- App repos:
af-corporation-outlook-com/{ged_backend, agbale_frontend, afcm-backend, afcm-front} - Superrepo:
af-corporation-outlook-com/dowonou-deploy - DOCR registry:
registry.digitalocean.com/afcorp - DO cluster name (for
doctl kubeconfig save):af-sandbox(override via superrepo varDO_CLUSTER)
1. Shared GitHub App (cross-repo bump identity)
Section intitulée « 1. Shared GitHub App (cross-repo bump identity) »Used by app CI to write the superrepo, and by promote.yml to dispatch frontend builds.
- Org → Settings → Developer settings → GitHub Apps → New GitHub App.
- Permissions: Repository → Contents: Read & write, Pull requests: Read & write
(the DEV bump lands as an auto-merge PR —
mainis protected, direct push is rejected), Metadata: Read-only, Actions: Read & write (sopromote.ymlcan dispatch + watchbuild-env.yml). - No webhook needed.
- NOTE: if you add Pull requests after first creating the App, you must re-accept
the permission on each installation (GitHub emails an approval link / Settings →
Installations → Configure), or
gh pr createfails with 403.
- Permissions: Repository → Contents: Read & write, Pull requests: Read & write
(the DEV bump lands as an auto-merge PR —
- Install it on all four app repos and the superrepo.
- Generate a private key; note the App ID.
- Add as org secrets (or per-repo) so each app repo and the superrepo can read them:
- App repos need:
DEPLOY_APP_ID,DEPLOY_APP_PRIVATE_KEY - Superrepo
promote.ymlneeds:APP_ID,APP_PRIVATE_KEY - (Two name pairs because the app workflows and promote.yml were kept independent; you may point both at the same App — just set both name pairs to the same values.)
- App repos need:
2. DOCR push token (app repos)
Section intitulée « 2. DOCR push token (app repos) »App pipelines build & push images; they do not get cluster access.
- DigitalOcean → API → Tokens, or Container Registry → Settings, create a token with registry read & write.
- Add as secret
DIGITALOCEAN_ACCESS_TOKENin each app repo (or as an org secret). - Ensure each cluster namespace (
agbale-dev,agbale-staging,agbale-prod) has a DOCR image pull secret so deployed pods can pull. (DigitalOcean → Container Registry → “DigitalOcean Kubernetes integration” wires this automatically per cluster.)
3. Superrepo GitHub Environments (cluster credentials — the ONLY place they live)
Section intitulée « 3. Superrepo GitHub Environments (cluster credentials — the ONLY place they live) »In dowonou-deploy → Settings → Environments, create three:
| Environment | Secret | Protection |
|---|---|---|
dev |
DIGITALOCEAN_ACCESS_TOKEN (DEV cluster) |
none (auto-deploy) |
staging |
DIGITALOCEAN_ACCESS_TOKEN (staging cluster) |
optional reviewers |
production |
DIGITALOCEAN_ACCESS_TOKEN (PROD cluster) |
Required reviewers = deploy leads; optional wait timer |
- The deploy job maps manifest env
prod→ GitHub Environmentproduction. - If DEV/staging/PROD share one cluster today, use the same token in each — the isolation still holds once clusters split, with no workflow change.
- Optional: restrict each Environment’s deployment branches to
main. - Also set, if you run e2e:
E2E_USERNAME,E2E_PASSWORD(repo or env secrets).
4. Superrepo main protection (the DEV-auto / promo-gated split)
Section intitulée « 4. Superrepo main protection (the DEV-auto / promo-gated split) »Goal: let the GitHub App auto-land DEV bumps as PRs, but force lead review on staging/PROD.
The DEV bump opens a PR and self-merges — main requires a PR, so the App needs
Pull requests: write (Section 1) and the repo needs Allow auto-merge enabled
(Settings → General → Pull Requests).
Use classic branch protection (Settings → Branches) OR a ruleset — either works.
Required settings on main:
- Require a pull request before merging, Required approvals = 0.
- Require review from Code Owners: enable.
CODEOWNERSscopes owners to/environments/staging/and/environments/prod/only. Net effect: a DEV-only change (environments/dev/**) matches no code owner → 0 approvals → the bot’s PR auto-merges; a staging/PROD change requires the leads team.
This was applied via the API as classic protection:
required_approving_review_count: 0, require_code_owner_reviews: true.
- Create the team
@af-corporation-outlook-com/dowonou-leadsand give it write on the repo (rename in.github/CODEOWNERSif you use a different slug). ⚠️ With code-owner review required, staging/PROD PRs are unmergeable until this team exists — DEV is unaffected. - Allow the GitHub App to bypass PR requirements for
environments/dev/**, OR (simpler) rely on the 0-approval + path-scoped-codeowners combination above so a direct push of a DEV-only change is permitted. Verify with a test bump (Section 6).
If your org enforces “require PR for all pushes to main” with no bypass, switch the app
deploy-dev.ymlbump to open an auto-merge PR forenvironments/dev/**instead of pushing tomaindirectly, and enable repo Allow auto-merge.
5. Per-app variables (optional; defaults baked in)
Section intitulée « 5. Per-app variables (optional; defaults baked in) »Workflows default these, override only if names differ:
- App repos:
DO_REGISTRY(defaultregistry.digitalocean.com/afcorp),DEPLOY_REPO(defaultaf-corporation-outlook-com/dowonou-deploy). - Superrepo:
DO_CLUSTER(defaultaf-sandbox),APP_REPO_ORG(defaultaf-corporation-outlook-com).
6. Validate the DEV path (one app, end to end)
Section intitulée « 6. Validate the DEV path (one app, end to end) »- Make sure
agbale-ged-backend:<sha>can be built — push a trivial commit toged_backendmain. - Confirm
deploy-dev.yml: builds, pushesagbale-ged-backend:<short-sha>, and opens/pushes a superrepo commit updatingenvironments/dev/versions.yaml(ged-backend.tag = <short-sha>) and theged_backendgitlink. - Confirm the superrepo
deploy.ymlruns for dev only and helm-upgradesagbale-devwith the new tag; staging/PROD untouched.
7. Validate promotion
Section intitulée « 7. Validate promotion »- Run Actions → Promote with
from_env=dev, to_env=staging, apps=ged-backend. - Confirm it opens a PR editing
environments/staging/versions.yaml, requires the leads’ review (CODEOWNERS), and on merge deploys staging with the same tag. - Repeat
staging → prod; confirm theproductionEnvironment blocks on required reviewers before the deploy runs.
Rollback
Section intitulée « Rollback »- Revert the offending manifest commit on
main(re-triggersdeploy.ymlfor that env), or workflow_dispatchDeploy for the env after editing the manifest back to a known-good pin.
Open placeholders to resolve
Section intitulée « Open placeholders to resolve »- Create team
@af-corporation-outlook-com/dowonou-leads(or edit.github/CODEOWNERS). - Decide whether one GitHub App backs both
DEPLOY_APP_*andAPP_*name pairs. - Confirm the
afcm-frontsubmodule is repointed tomaster(it currently tracks the feature branchDT-002-helm-charts). - Confirm DEV/staging/PROD cluster split (one cluster today → same token in all envs).