fix(deploy): use ssh-agent for VPS Deploy SSH key

printf of VPS_SSH_KEY produced a corrupted private key on the runner
(libcrypto error). Switch to webfactory/ssh-agent which handles multiline
OpenSSH keys reliably.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mauricio Barragan
2026-07-19 12:52:35 -06:00
parent 71c45dca9a
commit 5f8da3487f
+8 -5
View File
@@ -59,16 +59,19 @@ jobs:
needs: build-push needs: build-push
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Setup SSH - name: Install SSH key
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.VPS_SSH_KEY }}
- name: Trust VPS host key
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
printf '%s' "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/deploy_key ssh-keyscan -H "${{ secrets.VPS_HOST }}" >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H "${{ secrets.VPS_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null
- name: Pull image and restart app - name: Pull image and restart app
run: | run: |
ssh -i ~/.ssh/deploy_key "${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}" bash -s <<'EOF' ssh "${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}" bash -s <<'EOF'
set -euo pipefail set -euo pipefail
cd /root/projects/arbpulse cd /root/projects/arbpulse
git fetch origin main git fetch origin main