Prompt file imported from achimdehnert/platform (
.windsurf/workflows/deploy.md). Fill in{{GITHUB_DIR}},{{end}}before use. Copyright stays with the author.
Deploy Workflow
⛔ DEPRECATED — Prod-Deploy-Kanon ist
/ship(Standard-Pfad). Nutze/shipfür den regulären App-Deploy (verify → push → CI → migrate → health-check) und/run-prodnur als manuellen Notfall-Handpfad (direktesdocker composemit sauberem Ja/Nein-Gate). Dieser Workflow (infra-deploy-Actions) wird nicht mehr als Einstieg gepflegt und bleibt nur als Referenz für die infra-deploy-Mechanik stehen. Rollback:/rollback.
Architektur (ADR-075 + ADR-100): Deployments sind Aufgabe des Deployment Agent. Cascade (Tech Lead) genehmigt nur bei Gate-2-Situationen (neue Migrations, Breaking Changes). Write-Ops laufen über GitHub Actions — NICHT via direktem SSH (hängt). Read-Ops (Logs, Status) via
deployment-mcpTools.
Rollen-Trennung (ADR-100)
| Wer | Was |
|---|---|
| Deployment Agent | Deploy-Ausführung nach CI grün — Freigabe-Pflicht siehe ~/.claude/policies/autonomy-gates.md Gate 2 (Prod-Deploy braucht IMMER Freigabe, keine Routine-Ausnahme) |
| Cascade (Tech Lead) | Gate-2-Approval bei neuen Migrations / Breaking Changes |
| Mensch | Gate-3/4 bei kritischen Prod-Änderungen |
Workflow-Übersicht
| Operation | Methode | Link |
|---|---|---|
| Deploy | infra-deploy → deploy-service.yml |
https://github.com/achimdehnert/infra-deploy/actions |
| Rollback | infra-deploy → rollback.yml |
https://github.com/achimdehnert/infra-deploy/actions |
| Migrations | infra-deploy → migrate.yml |
https://github.com/achimdehnert/infra-deploy/actions |
| DB-Backup | infra-deploy → db-backup.yml |
https://github.com/achimdehnert/infra-deploy/actions |
| Health-Check | infra-deploy → health-check.yml |
https://github.com/achimdehnert/infra-deploy/actions |
Pre-Deploy: ADR Freshness Gate (iil-adrfw v0.4.0)
ℹ️ CC-Fallback: Die
mcp2_adr_*-Aufrufe unten sind Windsurf-Ära-Namen; in Claude-Code-Sessions heißen dieselben Toolsmcp__<orchestrator-prefix>__adr_*(Prefix ausproject-facts.md). Bindet die Session keinen ADR-MCP-Server, ist der Fallback deriil-adrfw-CLI-Weg bzw. direkte Reads indocs/adr/— der Deploy bricht nicht ab, nur die MCP-Automatik entfällt. (Muster:session-start.md.)
Vor jedem Deploy prüfen ob die ADRs noch zum aktuellen Repo-Stand passen:
MCP: mcp2_adr_freshness(repo_path="{{GITHUB_DIR}}/<SERVICE>")
→ Prüft Version/Port/Image Claims in ADRs gegen compose + requirements
→ severity=warning: Version-Drift (z.B. ADR sagt PostgreSQL 15, Repo hat 16)
→ severity=info: Port-Abweichung (oft irrelevant, nur bei eigenem Repo-Port warnen)
| Ergebnis | Aktion |
|---|---|
| 0 stale_claims | ✅ Deploy fortsetzen |
Nur info Findings |
✅ Deploy fortsetzen, optional ADR updaten |
warning Findings |
⚠️ User informieren — Deploy möglich, aber ADR-Update empfohlen |
| Version-Mismatch bei Kern-Infra (DB, Python) | ❌ Erst ADR aktualisieren, dann deployen |
→ Verhindert Drift zwischen ADR-Dokumentation und tatsächlichem System-Stand.
Deploy via GitHub Actions (Standard)
1. Service deployen (GitHub UI)
- → https://github.com/achimdehnert/infra-deploy/actions/workflows/deploy-service.yml
- Run workflow → Inputs:
service:bfagent|travel-beat|weltenhub|risk-hub|dev-hub|wedding-hubimage_tag:latestoder SHAhas_migrations:trueoderfalse
2. Service deployen (Agent)
Verwende <deployment-mcp>_cicd_manage (Prefix aus mcp-tools.md) mit action: dispatch:
owner: achimdehnert
repo: infra-deploy
workflow_id: deploy-service.yml
ref: main
inputs: {service: "travel-beat", image_tag: "latest", has_migrations: "false"}
Dann Status pollen mit <deployment-mcp>_cicd_manage (Prefix aus mcp-tools.md) → action: run_status.
Rollback
- → https://github.com/achimdehnert/infra-deploy/actions/workflows/rollback.yml
- Run workflow →
service+ optionaltarget_tag(leer = vorheriger Tag)
Migrations (ohne Deploy)
- → https://github.com/achimdehnert/infra-deploy/actions/workflows/migrate.yml
- Run workflow →
service+backup_first: true(empfohlen)
DB-Backup (manuell)
- → https://github.com/achimdehnert/infra-deploy/actions/workflows/db-backup.yml
- Run workflow →
service
Automatisch: täglich 02:00 UTC für alle Services.
Deploy-Status prüfen (Read-Only via deployment-mcp)
Container-Logs
Verwende deployment-mcp → container_logs Tool.
Compose-Status
Verwende deployment-mcp → compose_ps Tool.
Deploy-History
→ https://github.com/achimdehnert/infra-deploy/actions
Troubleshooting
- Workflow hängt: Runner-Status → https://github.com/achimdehnert/infra-deploy/settings/actions/runners
- Deploy fehlgeschlagen: Auto-Rollback greift — Deploy-Log via
deployment-mcp→ssh_manage file_read /opt/deploy/production/.deployed/deploy.log - Health-Check manuell:
infra-deploy→health-check.yml→ Run workflow - NIEMALS:
deployment-mcpWrite-Tools (compose_up, compose_restart) für Deploys verwenden → hängt (ADR-075)
Lessons Learned (Feb 2026)
Private Repo Dependencies im Docker-Build
git+https:// in requirements.txt schlägt im Docker-Build fehl (keine GitHub-Auth).
Lösung: Vendor-Pattern — Package unter vendor/ im Repo, requirements.txt referenziert lokalen Pfad.
Siehe: wedding-hub/.windsurf/workflows/platform-package-integration.md
SSH-Timeouts bei Build-Operationen
| Operation | Min. Timeout |
|---|---|
| Docker Build | 300-600s |
| Docker Push | 300s |
| Compose Pull | 120s |
| Git Pull | 30s |
Bei deployment-mcp → ssh_manage exec immer timeout: 600 für Build-Operationen!
DB-Credentials nie raten
Immer zuerst Container-Environment inspizieren:
docker inspect <container> --format '{{range .Config.Env}}{{println .}}{{end}}' | grep POSTGRES
Server-Pfade nachschlagen
Nicht raten — in project-facts.md des jeweiligen Repos nachschauen oder:
find /opt -maxdepth 2 -name "docker-compose.prod.yml" 2>/dev/null