Debugging outputs for SSH setup
Some checks failed
Build and Deploy Hugo / deploy (push) Failing after -11m50s

This commit is contained in:
Alex Selimov 2025-07-12 22:29:00 -04:00
parent da489ebded
commit 5a53f8cf4a
Signed by: aselimov
GPG key ID: 3DDB9C3E023F1F31

View file

@ -28,12 +28,22 @@ jobs:
run: hugo --minify
- name: Setup SSH
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
echo "Setting up 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
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
run: rsync -azvr public/* root@smokey:/var/www/alexselimov.com/