Debugging outputs for SSH setup
Some checks failed
Build and Deploy Hugo / deploy (push) Failing after -11m50s
Some checks failed
Build and Deploy Hugo / deploy (push) Failing after -11m50s
This commit is contained in:
parent
da489ebded
commit
5a53f8cf4a
1 changed files with 12 additions and 2 deletions
|
@ -28,12 +28,22 @@ jobs:
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
||||||
run: |
|
run: |
|
||||||
|
echo "Setting up SSH..."
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
if [ -z "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
|
||||||
|
echo "ERROR: SSH_PRIVATE_KEY secret is not set!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "SSH_PRIVATE_KEY secret is present"
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan -H smokey >> ~/.ssh/known_hosts
|
chmod 700 ~/.ssh
|
||||||
|
echo "SSH key saved and permissions set" ssh-keyscan -H smokey >> ~/.ssh/known_hosts
|
||||||
|
echo "Host key added to known_hosts"
|
||||||
|
# Test SSH connection
|
||||||
|
echo "Testing SSH connection..."
|
||||||
|
ssh -o StrictHostKeyChecking=no -o BatchMode=yes root@smokey "echo 'SSH connection successful'" || echo "SSH connection failed"
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: rsync -azvr public/* root@smokey:/var/www/alexselimov.com/
|
run: rsync -azvr public/* root@smokey:/var/www/alexselimov.com/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue