Skip to content

ci: collapse preview + production deploy into one reusable workflow#130

Merged
posix4e merged 1 commit into
feat/unify-workloadsfrom
feat/unify-deploy-workflows
Apr 18, 2026
Merged

ci: collapse preview + production deploy into one reusable workflow#130
posix4e merged 1 commit into
feat/unify-workloadsfrom
feat/unify-deploy-workflows

Conversation

@posix4e
Copy link
Copy Markdown
Member

@posix4e posix4e commented Apr 18, 2026

Summary

  • New .github/workflows/deploy-cp.yml reusable workflow: auth → gcp-deploy.sh → wait-for-health-with-serial → /cp/attest MRTD verify → dashboard 200 → STONITH verify → optional PR comment → cascade dd-local-{kind} relaunch.
  • release.yml deploy-preview collapses from ~220 lines to 15 — uses: ./.github/workflows/deploy-cp.yml with preview inputs.
  • production-deploy.yml deploy collapses from ~110 lines to 15 — same workflow, prod inputs. Prod now runs /cp/attest MRTD verify for the first time (preview already did).
  • New .github/actions/relaunch-agent/ composite action holds the SSH + dd-relaunch.sh body; shared between deploy-cp.yml (cascade path) and local-agents.yml (operator dispatch).
  • local-agents.yml shrinks to workflow_dispatch-only — the everyday cascade now flows through deploy-cp.yml. Net: 543 lines deleted, 432 added across the changed files.

Depends on #127 — built on top of that branch so the preview probe + REF plumbing don't have to be re-invented. Retarget to main after #127 merges.

Test plan

  • Open a throwaway PR. Release → deploy-cp.yml(preview) runs, /cp/attest returns a valid MRTD, preview URL comment posts, relaunch-agent cascades → dd-local-preview relaunches against pr-N.devopsdefender.com.
  • Merge to main. Production Deploy → deploy-cp.yml(production) runs with the same body — /cp/attest now also verifies prod (new signal), STONITH reaps old prod VM, dd-local-prod relaunches.
  • workflow_dispatch on Local Agents fires a manual relaunch without touching the CP (validates the script-iteration path).
  • git diff .github/workflows/release.yml .github/workflows/production-deploy.yml shows only trigger + input differences, zero duplicated steps (code-reuse invariant).

🤖 Generated with Claude Code

Preview and production share scripts/gcp-deploy.sh but each had its own
job body in release.yml and production-deploy.yml — three copies of the
same health-wait, STONITH, dashboard verify, drifting apart (preview
already ran /cp/attest MRTD verify; prod didn't).

Extract the common body into .github/workflows/deploy-cp.yml as a
reusable workflow. release.yml deploy-preview and production-deploy.yml
deploy both call it with env-specific inputs. Prod now runs the stronger
MRTD attestation check preview already had, and every PR push exercises
the exact code prod uses.

Move the SSH+relaunch of dd-local-{kind} into a composite action
.github/actions/relaunch-agent/ so deploy-cp.yml can cascade it
directly. local-agents.yml shrinks to a workflow_dispatch-only entry
point for operator-driven one-shots.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@posix4e posix4e merged commit bc9b56a into feat/unify-workloads Apr 18, 2026
1 check passed
@posix4e posix4e deleted the feat/unify-deploy-workflows branch April 18, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant