From 6cad39f415d1247dc7465e5c5ff703e5244743e0 Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Thu, 21 Mar 2024 17:52:41 +0100 Subject: [PATCH] fix: file issue for ssh key --- .github/workflows/publish.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index edf9a13..01f3099 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,9 +23,8 @@ jobs: npm install npm run build - - name: Print SSH Key to File - run: echo "${{ secrets.VPS_SSH_KEY }}" > ssh_key - - name: Deploy to VPS + env: + SSH_PRIVATE_KEY: ${{ secrets.VPS_SSH_KEY }} run: | - scp -o StrictHostKeyChecking=no -i ssh_key -r dist/* ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }}:${{ secrets.VPS_PROJECT_FOLDER }} + scp -o StrictHostKeyChecking=no -i <(echo "$SSH_PRIVATE_KEY") ssh_key -r dist/* ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }}:${{ secrets.VPS_PROJECT_FOLDER }}