diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml index 65b79022..12224d04 100644 --- a/.github/workflows/deploy-dev.yaml +++ b/.github/workflows/deploy-dev.yaml @@ -87,7 +87,17 @@ jobs: DEPLOY_CMD="reset-zkcoins-node" fi + # ServerAlive* keep the session alive across long-running + # `docker compose recreate` steps where the remote command + # produces no stdout for >60s. Without keepalive the + # cloudflared tunnel (and the OpenSSH client) drop the + # session and exit 255 even though the host-side deploy + # script keeps running — observed on the PR #111 merge + # (run 26419696840). 30s interval × 8 retries = 4 min of + # network silence tolerated before the session is killed. ssh -i ~/.ssh/deploy_key \ + -o ServerAliveInterval=30 \ + -o ServerAliveCountMax=8 \ -o ProxyCommand="cloudflared access ssh --hostname ${{ secrets.DEPLOY_DEV_HOST }}" \ ${{ secrets.DEPLOY_DEV_USER }}@${{ secrets.DEPLOY_DEV_HOST }} \ "$DEPLOY_CMD" diff --git a/.github/workflows/deploy-prd.yaml b/.github/workflows/deploy-prd.yaml index 3257b9a1..8af19ffe 100644 --- a/.github/workflows/deploy-prd.yaml +++ b/.github/workflows/deploy-prd.yaml @@ -63,7 +63,15 @@ jobs: echo "${{ secrets.DEPLOY_PRD_SSH_KEY }}" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key echo "${{ secrets.DEPLOY_PRD_SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + # ServerAlive* keep the session alive across long-running + # `docker compose recreate` steps where the remote command + # produces no stdout for >60s. Mirrors deploy-dev.yaml; see + # the comment there for the failure mode that motivated this + # (PR #111 merge run 26419696840 — SSH dropped mid-recreate, + # exit 255, container actually came up server-side). ssh -i ~/.ssh/deploy_key \ + -o ServerAliveInterval=30 \ + -o ServerAliveCountMax=8 \ -o ProxyCommand="cloudflared access ssh --hostname ${{ secrets.DEPLOY_PRD_HOST }}" \ ${{ secrets.DEPLOY_PRD_USER }}@${{ secrets.DEPLOY_PRD_HOST }} \ "zkcoins-node"