diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a82a9992..2da78029 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -46,11 +46,14 @@ jobs: ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts 2>/dev/null - ssh -o StrictHostKeyChecking=accept-new deploy@alpha.mintel.me "bash -s" << 'ENDSSH' - set -e - echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin - cd /home/deploy/sites/klz-cables.com - docker compose pull - docker compose up -d --force-recreate --remove-orphans - docker image prune -f - ENDSSH \ No newline at end of file + # Use SSH with connection keepalive and execute commands directly + ssh -o StrictHostKeyChecking=accept-new \ + -o ServerAliveInterval=30 \ + -o ServerAliveCountMax=3 \ + -o ConnectTimeout=10 \ + deploy@alpha.mintel.me \ + "echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin && \ + cd /home/deploy/sites/klz-cables.com && \ + docker compose pull && \ + docker compose up -d --force-recreate --remove-orphans && \ + docker image prune -f" \ No newline at end of file