deploy test
All checks were successful
/ deploy (push) Successful in 42s

This commit is contained in:
Mans Ziesel 2024-04-27 19:35:42 +02:00
parent 84c5b1a04b
commit a1027bb23c

View File

@ -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'