Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 39s

This commit is contained in:
sotos
2025-12-17 08:52:24 +01:00
parent 7bade2f31e
commit 3108c915c8

View File

@@ -41,18 +41,14 @@ jobs:
- name: Setup SSH key with passphrase
run: |
mkdir -p ~/.ssh
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "${{ secrets.SSH_PASSPHRASE }}"
echo " Checking SSH key setup..."
head -5 ~/.ssh/id_rsa | cat -v
ls -l ~/.ssh/id_rsa
file ~/.ssh/id_rsa || echo "file command not available"
echo " Testing SSH connection..."
ssh -i ~/.ssh/id_rsa root@213.95.90.157 'echo SSH connection successful'
echo " Running Ansible Playbook..."
- name: Run Ansible deployment
run: |
if [ -n "$SSH_PASSPHRASE" ]; then
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
fi
ansible-playbook -i ansible/inventory.yaml site.yaml