feat(infra): staging-deploy workflow + Docker CE staging runtime #133

Merged
amiryahaya merged 1 commit from feat/staging-cd into main 2026-11-09 16:57:28 +01:00
Owner

Staging CD (phase 1 of the VPS bring-up — box is live: Contabo 8 GB/96 GB Ubuntu 26.04, user deploy, reachable as ssh failsulit):

  • .github/workflows/staging-deploy.yml: push-to-main (api/compose/workflow paths) + workflow_dispatch → builds + pushes api:staging (kaz-setup composite + Containerfile, same registry creds as cd.yml) → SSH-deploys to the VPS: syncs compose.yml + staging-deploy.sh and runs them (pull :staging, up -d, /health/ smoke). SSH via repo secrets STAGING_SSH_HOST/USER/KEY/KNOWN_HOSTS (provisioned via API); concurrency group cancels in-flight deploys.
  • scripts/staging-deploy.sh (runs ON the VPS): idempotent Docker guard, first-run .env bootstrap with GENERATED secrets (POSTGRES_PASSWORD, Auth__TotpEncryptionKey), ASPNETCORE_ENVIRONMENT=Development on staging (auto-migrate ON; Production keeps deliberate migrations), tag pinning, health smoke with log dump on failure.
  • compose.yml parameterized for both environments: POSTGRES_* / ASPNETCORE_ENVIRONMENT / API_IMAGE_TAG via .env (prod defaults unchanged: latest + Production).
  • Out-of-band VPS bootstrap (this session): Docker CE 29.9.3 installed, deploy in docker group, Forgejo registry login (PAT), ~/deploy/failsulit/{app,idp} scaffolded.

After merge: run staging-deploy (workflow_dispatch) to bring the app stack live; IdP stack + realm bootstrap + Auth:IdpEnabled flip follow in phase 2.

Staging CD (phase 1 of the VPS bring-up — box is live: Contabo 8 GB/96 GB Ubuntu 26.04, user deploy, reachable as `ssh failsulit`): - **.github/workflows/staging-deploy.yml**: push-to-main (api/compose/workflow paths) + workflow_dispatch → builds + pushes **api:staging** (kaz-setup composite + Containerfile, same registry creds as cd.yml) → SSH-deploys to the VPS: syncs compose.yml + staging-deploy.sh and runs them (pull `:staging`, up -d, /health/ smoke). SSH via repo secrets STAGING_SSH_HOST/USER/KEY/KNOWN_HOSTS (provisioned via API); concurrency group cancels in-flight deploys. - **scripts/staging-deploy.sh** (runs ON the VPS): idempotent Docker guard, first-run .env bootstrap with GENERATED secrets (POSTGRES_PASSWORD, Auth__TotpEncryptionKey), ASPNETCORE_ENVIRONMENT=Development on staging (auto-migrate ON; Production keeps deliberate migrations), tag pinning, health smoke with log dump on failure. - **compose.yml** parameterized for both environments: POSTGRES_* / ASPNETCORE_ENVIRONMENT / API_IMAGE_TAG via .env (prod defaults unchanged: latest + Production). - Out-of-band VPS bootstrap (this session): Docker CE 29.9.3 installed, deploy in docker group, Forgejo registry login (PAT), ~/deploy/failsulit/{app,idp} scaffolded. After merge: run staging-deploy (workflow_dispatch) to bring the app stack live; IdP stack + realm bootstrap + Auth:IdpEnabled flip follow in phase 2.
feat(infra): staging-deploy workflow + Docker CE staging runtime (staging bring-up, phase 1)
All checks were successful
Security CI / security-scan (pull_request) Successful in 4m4s
a110abe232
- .github/workflows/staging-deploy.yml: push-to-main (api/compose/workflow
  paths) + workflow_dispatch → build+push api:staging (kaz-setup composite,
  Containerfile) → SSH deploy: sync compose.yml + staging-deploy.sh, run
  it (pull :staging, up -d, /health/ smoke). SSH via repo secrets
  (STAGING_SSH_HOST/USER/KEY/KNOWN_HOSTS — provisioned); concurrency
  group cancels in-flight deploys.
- scripts/staging-deploy.sh (runs ON the VPS): idempotent docker guard,
  first-run .env bootstrap with GENERATED secrets (POSTGRES_PASSWORD,
  Auth__TotpEncryptionKey), ASPNETCORE_ENVIRONMENT=Development on staging
  (auto-migrate ON — Production keeps deliberate migrations), tag pinning,
  /health/ smoke with log dump on failure.
- compose.yml parameterized for both environments: POSTGRES_* +
  ASPNETCORE_ENVIRONMENT + API_IMAGE_TAG via .env (prod default: latest +
  Production, unchanged).
- VPS bootstrapped out-of-band: Docker 29.9.3, deploy in docker group,
  forgejo registry login (PAT), ~/deploy/failsulit/{app,idp} scaffolded.
Sign in to join this conversation.
No description provided.