ci: add Ansible deploy step with image_tag; update inventory IP
CI / smoke-test (push) Failing after 20s
CI / smoke-test (push) Failing after 20s
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user