Skip to content

Commit 939857e

Browse files
fix workflow
1 parent a75be1f commit 939857e

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/ansible-deploy.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ jobs:
3939
needs: lint
4040
runs-on: self-hosted
4141
steps:
42-
- uses: actions/checkout@v4
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
- name: Install Ansible
45+
run: |
46+
sudo apt update
47+
sudo apt install -y ansible
4348
- name: Deploy with Ansible
4449
run: |
4550
cd ansible
46-
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > /tmp/vault_pass
4751
ansible-playbook playbooks/deploy.yml \
48-
--vault-password-file /tmp/vault_pass \
49-
--tags "app_deploy"
50-
rm /tmp/vault_pass
52+
--tags "app_deploy" \
53+
--connection=local \
54+
--inventory="localhost," \
55+
-e "ansible_host=127.0.0.1"
5156
- name: Verify Deployment
5257
run: |
5358
sleep 10 # Wait for app to start
54-
curl -f http://${{ secrets.VM_HOST }}:8000 || exit 1
55-
curl -f http://${{ secrets.VM_HOST }}:8000/health || exit 1
59+
curl -f http://localhost:8000 || exit 1
60+
curl -f http://localhost:8000/health || exit 1

ansible/playbooks/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Deploy application
3-
hosts: webservers
3+
hosts: all
44
become: true
55

66
roles:

ansible/playbooks/provision.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Provision web servers
3-
hosts: webservers
3+
hosts: all
44
become: true
55

66
roles:

0 commit comments

Comments
 (0)