# End-to-End Deploy Flow This is the canonical sequence the deploy_skill walks a project through. Every box is a script in `deploy_skill/scripts/`. Diamonds are decisions the operator (or the agent on behalf of the operator) makes. ``` ┌──────────────────────────┐ │ local project dir │ │ (with source code) │ └────────────┬─────────────┘ │ ┌─────────────────▼──────────────────┐ │ Initialize-CoolifyProject.ps1 │ │ -Stack node|python|compose|static │ │ -AppPort │ │ writes Dockerfile, compose, │ │ .dockerignore, .gitignore additions │ └─────────────────┬──────────────────┘ │ ┌─────────────────▼──────────────────┐ │ Test-PreDeployChecklist.ps1 -Strict│ │ enforces AGENTS-coolify-apps.md │ └────────────┬───────────────┬────────┘ FAIL ◄──┤ ├── PASS │ │ STOP + report │ │ ┌────────────────────────────▼────────┐ │ New-GitHubRepo.ps1 │ │ -Name │ │ uses GITHUB_TOKEN (PAT) │ └────────────────────────────┬─────────┘ │ ┌────────────────────────────▼─────────┐ │ git init / add / commit / push │ │ uses wincred (NOT the PAT) │ └────────────────────────────┬─────────┘ │ ┌────────────────────────────▼─────────┐ │ New-CoolifyApplication.ps1 │ │ - resolve project (+ create) │ │ - resolve environment (+ create) │ │ - resolve server │ │ - POST /applications/public │ │ - POST /applications//envs │ │ - POST /deploy │ └────────────────────────────┬─────────┘ │ ┌────────────────────────────▼─────────┐ │ Test-PostDeploy.ps1 │ │ - curl -I https:// │ │ - docker exec getent hosts │ │ - coolify-proxy logs grep │ │ - /applications/ (API) │ └────────────────────────────┬─────────┘ │ LIVE on FQDN ◄ ``` `Publish-ProjectToCoolify.ps1` chains all six steps with one confirmation prompt each (or `-Force` for unattended runs). ## Branching the flow - **Already-deployed app, just env change** → skip steps 1, 3, 4; call `New-CoolifyApplication.ps1 -ApplicationUuid ` (it PATCHes instead of creating). - **Rollback to old commit** → `Invoke-CoolifyRollback.ps1`; pushes a `rollback/` branch and repoints the app, leaving `main` intact. - **No code yet, only validate ideas** → just run `Test-PreDeployChecklist.ps1` against a skeleton.