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

This commit is contained in:
sotos
2025-12-16 12:27:08 +01:00
parent 10a48b6bc2
commit ff224549ed

View File

@@ -38,18 +38,21 @@ jobs:
apt-get update && apt-get install -y python3 python3-pip openssh-client bash git apt-get update && apt-get install -y python3 python3-pip openssh-client bash git
pip3 install --upgrade pip pip3 install --upgrade pip
pip3 install ansible pip3 install ansible
- name: Setup SSH - name: Setup SSH key with passphrase
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "${{ secrets.SSH_PASSPHRASE }}"
- name: Test SSH connection
run: |
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=yes root@213.95.90.157 'echo SSH OK'
- name: Run Ansible deployment - name: Run Ansible deployment
run: ansible-playbook -i ansible/inventory.yaml site.yaml 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