fix: make deploy resilient with || true instead of && chains
Build & Deploy / build-and-push (backend) (push) Successful in 25s
Build & Deploy / build-and-push (discord-gateway) (push) Successful in 26s
Build & Deploy / build-and-push (proxy) (push) Successful in 4m10s

docker compose down can fail silently, breaking the && chain
and preventing docker rm -f from running. Using || true on
each step ensures every cleanup command runs independently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-07-28 07:19:08 +07:00
co-authored by Claude Opus 4.8
parent c8975b6f6d
commit 4c9786c988
+2 -2
View File
@@ -62,6 +62,6 @@ jobs:
echo "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ENV_B64=$(echo "$ENV_FILE" | base64 -w0)
ssh -o StrictHostKeyChecking=accept-new \
ssh -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 -o ServerAliveCountMax=3 \
"$VPS_USER@$VPS_HOST" \
"cd /opt/imphenbot/infra/docker && echo '$ENV_B64' | base64 -d > .env && docker compose pull && docker compose down --remove-orphans && docker rm -f imphenbot-discord-gateway imphenbot-backend imphenbot-proxy 2>/dev/null; docker compose up -d --remove-orphans && docker image prune -f"
"cd /opt/imphenbot/infra/docker && echo '$ENV_B64' | base64 -d > .env && docker compose pull || true && docker compose down --remove-orphans || true && docker rm -f imphenbot-discord-gateway imphenbot-backend imphenbot-proxy || true && docker compose up -d --remove-orphans && docker image prune -f"