From 97b8103c37151264aed6901b68b7ff6e1a93943c Mon Sep 17 00:00:00 2001 From: Felix Faerber Date: Wed, 27 May 2026 13:03:20 +0300 Subject: [PATCH] deploy stack after building gateway image Was only building + pushing; swarm kept running the previous image until someone ran service update --force. Mirror the frontend workflow: ssh in and `docker stack deploy --resolve-image always` so every main push rolls out. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/docker.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6c24fa9..49a4567 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -45,3 +45,15 @@ jobs: COMMIT_SHA=${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max + + - name: docker stack deploy + if: github.event_name != 'pull_request' + uses: appleboy/ssh-action@v1.0.3 + with: + username: root + host: ${{ secrets.SSH_KNOWN_HOSTS }} + key: ${{ secrets.SSH_PRIV_KEY }} + script: | + echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + docker stack deploy -c ~/devops/hostinger/prod-stack.yaml prod --with-registry-auth --resolve-image always + docker image prune -f --filter "until=24h"