ci: add Ansible deploy step with image_tag; update inventory IP
CI / smoke-test (push) Failing after 20s

This commit is contained in:
Mikhail Lobanov
2026-10-22 21:00:07 +03:00
parent 23421bb70d
commit fbf2ec7b1a
3 changed files with 13 additions and 2 deletions
+11
View File
@@ -60,3 +60,14 @@ jobs:
docker push mikhaillobanov/devops-platform:latest
docker push mikhaillobanov/devops-platform:${GITHUB_SHA}
- name: Deploy via Ansible
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
VM_TEST_SSH_KEY: ${{ secrets.VM_TEST_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$VM_TEST_SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@87.242.118.200 \
"cd /root/devops-platform && ansible-playbook -i ansible/inventory.ini ansible/playbooks/deploy_app.yml -e image_tag=${GITHUB_SHA}"