Merge pull request #7 from 3llimi/lab06 #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: "Ansible - Deploy Go App" | |
| on: | |
| push: | |
| branches: [main, master, lab06] | |
| paths: | |
| - 'ansible/vars/app_bonus.yml' | |
| - 'ansible/playbooks/deploy_bonus.yml' | |
| - 'ansible/roles/web_app/**' | |
| - '.github/workflows/ansible-deploy-bonus.yml' | |
| pull_request: | |
| branches: [main, master] | |
| paths: | |
| - 'ansible/vars/app_bonus.yml' | |
| - 'ansible/playbooks/deploy_bonus.yml' | |
| - 'ansible/roles/web_app/**' | |
| jobs: | |
| lint: | |
| name: "Ansible Lint - Bonus" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install ansible and ansible-lint | |
| run: pip install ansible ansible-lint | |
| - name: Run ansible-lint | |
| run: | | |
| cd ansible | |
| ansible-lint playbooks/deploy_bonus.yml | |
| deploy: | |
| name: "Deploy Bonus App" | |
| needs: lint | |
| runs-on: self-hosted | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run deploy playbook | |
| run: | | |
| cd ansible | |
| ansible-playbook playbooks/deploy_bonus.yml | |
| - name: Verify bonus app health | |
| run: | | |
| sleep 5 | |
| curl -f http://localhost:8001/health |