Commit1caf3caunknown_key
fix(deploy): skip rollback on manual workflow_dispatch + don't fail rollback step
fix(deploy): skip rollback on manual workflow_dispatch + don't fail rollback step Two fixes for the rollback step: 1. Skip rollback entirely on workflow_dispatch (manual runs). Forces a diagnose-before-revert posture when an operator is intentionally pushing a deploy and watching the result. 2. Use script_stop:false + '|| true' so a broken post-rollback systemd doesn't cascade into rollback-step failure. Rollback should always succeed even if the previous SHA is also broken. Real cause for these fixes: the auto-rollback was masking the real failure by reverting to a known-broken previous SHA, then failing on systemctl status of the broken-after-rollback service. Net effect: we couldn't tell if the new code worked, because rollback fired first and re-broke the box.
1 file changed+8−41caf3ca653004292d9d89f6e6f3c18e7b3c3ba01
1 changed file+8−4
Modified.github/workflows/vultr-deploy.yml+8−4View fileUnifiedSplit
@@ -90,23 +90,27 @@ jobs:
9090 exit 1
9191
9292 # ─── 4. Auto-rollback on smoke failure ──────────────────────────────
93 # Only rolls back if the workflow was triggered by a normal push.
94 # Manual workflow_dispatch runs SKIP rollback so the operator can
95 # diagnose the new code on the box before reverting. This stops the
96 # pathological case where rollback masks the real failure by reverting
97 # to an already-broken previous SHA.
9398 - name: Rollback on failure
94 if: failure() && steps.smoke.conclusion == 'failure'
99 if: failure() && steps.smoke.conclusion == 'failure' && github.event_name == 'push'
95100 uses: appleboy/ssh-action@v1.2.0
96101 with:
97102 host: ${{ secrets.VULTR_HOST }}
98103 username: ${{ secrets.VULTR_USER }}
99104 key: ${{ secrets.VULTR_SSH_KEY }}
100 script_stop: true
105 script_stop: false
101106 script: |
102 set -euo pipefail
103107 cd /opt/gluecron
104108 prev=$(cat /tmp/gluecron_prev_sha)
105109 echo "Rolling back to $prev"
106110 git reset --hard "$prev"
107111 systemctl restart gluecron
108112 sleep 5
109 systemctl status gluecron --no-pager | head -20
113 systemctl status gluecron --no-pager | head -20 || true
110114
111115 # ─── 5. Failure diagnostics — captured into a file for summary + AI ──
112116 - name: Capture failure context
113117