mirror of
https://github.com/mauricioabh/arbpulse.git
synced 2026-07-27 15:47:43 +00:00
Merge pull request #29 from mauricioabh/fix/vps-deploy-ssh
fix(deploy): use ssh-agent for VPS Deploy SSH key
This commit is contained in:
@@ -59,16 +59,19 @@ jobs:
|
||||
needs: build-push
|
||||
runs-on: ubuntu-latest
|
||||
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: |
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s' "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/deploy_key
|
||||
chmod 600 ~/.ssh/deploy_key
|
||||
ssh-keyscan -H "${{ secrets.VPS_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null
|
||||
ssh-keyscan -H "${{ secrets.VPS_HOST }}" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Pull image and restart app
|
||||
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
|
||||
cd /root/projects/arbpulse
|
||||
git fetch origin main
|
||||
|
||||
Reference in New Issue
Block a user