Files
Ansible-Minecraft-Server/.gitea/workflows/ci.yml
Hubert Cornet 2924f0e819
Some checks failed
Run ansible / ansible_lint_and_syntax_check (push) Failing after 47s
Run ansible / run-ansible-playbook (push) Has been skipped
Actualiser .gitea/workflows/ci.yml
2025-08-23 10:28:21 +02:00

69 lines
1.9 KiB
YAML

name: Run ansible
on:
push:
schedule:
- cron: "0 */12 * * *"
jobs:
ansible_lint_and_syntax_check:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install ansible
run: |
apt update && apt upgrade -y
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible and dependencies
run: |
pip install ansible ansible-lint
- name: Run Ansible Lint
run: ansible-lint
# - name: Run playbook "main"
# run: |
# ansible-playbook -K -l minecraft playbooks/00-main.yml --syntax-check
- name: Run playbook "base server"
run: |
ansible-playbook -K -l minecraft playbooks/01-install-server.yml --syntax-check
- name: Send failure notification
uses: dawidd6/action-send-mail@v3
if: always() && failure()
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: myuser
password: ${{ secrets.MAIL_PASSWORD }}
subject: ansible runbook failed
to: me@davegallant.ca
from: RFD Notify
body: |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}
run-ansible-playbook:
needs: ansible_lint_and_syntax_check # Ce job dépend du succès du précédent
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/main' # Ce job ne s'exécute que pour les push sur la branche 'main'
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible and dependencies
run: |
pip install ansible