From a1027bb23cc4b1f6aede115aa4c8ca96b90bd11c Mon Sep 17 00:00:00 2001 From: Mans Ziesel Date: Sat, 27 Apr 2024 19:35:42 +0200 Subject: [PATCH] deploy test --- .gitea/workflows/hugo.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/hugo.yaml b/.gitea/workflows/hugo.yaml index 698df9a..eb1f367 100644 --- a/.gitea/workflows/hugo.yaml +++ b/.gitea/workflows/hugo.yaml @@ -38,16 +38,17 @@ jobs: run: | mkdir -p /home/runner/.ssh ssh-keyscan ${{secrets.SSH_HOST}} >> /home/runner/.ssh/known_hosts - echo "${{ secrets.SSH_KEY }}" > /home/runner/.ssh/id_rsa - chmod 600 /home/runner/.ssh/id_rsa + echo "${{ secrets.SSH_KEY }}" > /home/runner/.ssh/id_deployer + chmod 600 /home/runner/.ssh/id_deployer ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add /home/runner/.ssh/id_rsa + ssh-add /home/runner/.ssh/id_deployer - name: Deploy to server env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | - scp ./website.tar ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{SCP_DEST}} + echo 'scp -i ~/.ssh/id_deployer ./website.tar ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{SCP_DEST}}' + scp -i ~/.ssh/id_deployer ./website.tar ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{SCP_DEST}} ssh ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} 'rm -r ${{WEB_DIR}}/*' ssh ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} 'tar -xf ${{SCP_DEST}}/website.tar --directory ${{WEB_DIR}}/' ssh ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} 'rm ${{SCP_DEST}}/website.tar'