Add SSH agent forwarding for deployment
Some checks failed
Deploy to Server / deploy (push) Failing after 4s
Some checks failed
Deploy to Server / deploy (push) Failing after 4s
- Initialize SSH agent forwarding to allow SSH key usage. - This resolves issues with deploying to the server. - Ensures the deployment process can access the SSH key.
This commit is contained in:
parent
72f8d98cec
commit
6a4aef9042
@ -15,6 +15,7 @@ jobs:
|
||||
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
eval "$(ssh-agent -s)"
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
chmod 700 ~/.ssh
|
||||
@ -24,6 +25,7 @@ jobs:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||
|
||||
|
||||
- name: Deploy via SSH
|
||||
run: |
|
||||
ssh -p "$SSH_PORT" "$SSH_USER@$SSH_HOST" 'cd /home/rogsme/repo && git stash && git pull --force origin master && ./build.sh'
|
||||
|
Loading…
x
Reference in New Issue
Block a user