From 8db8347df0de093fd071753b98ce46bf35fa3aab Mon Sep 17 00:00:00 2001 From: William Turner Date: Sun, 23 Aug 2026 15:11:31 +0000 Subject: [PATCH] Chain Portainer redeploy to the end of the build workflow, not a parallel webhook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The separate Gitea push webhook to Portainer fired in parallel with this build workflow on the same push event, so it could redeploy before the new image finished pushing — Portainer would then pull the still-current :latest tag and silently keep running old code. Removed that webhook; redeploy now only happens as this workflow's last step, after the image push actually completes. --- .gitea/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3081a91..53d50ac 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -31,3 +31,10 @@ jobs: IMAGE="${{ vars.REGISTRY_HOST }}/${{ gitea.repository }}/claude-agent:latest" docker build -t "$IMAGE" ./agent docker push "$IMAGE" + + - name: Trigger Portainer redeploy + # Deliberately NOT a separate Gitea repo webhook firing in parallel on the same + # push — that raced with this build and could redeploy before the new image was + # actually pushed, silently keeping the old code running. Chaining it here as the + # last step guarantees the image exists before Portainer goes to pull it. + run: curl -f -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"