This commit is contained in:
parent
84c5b1a04b
commit
a1027bb23c
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user