From 4a08944497a60571c2cf2af3c2ba2918879d12d3 Mon Sep 17 00:00:00 2001 From: bretello Date: Fri, 5 Jul 2024 22:16:26 +0200 Subject: [PATCH] gha: split workflows --- .github/workflows/ansible.yml | 36 +++++++++++++++++++++++++++++++ .github/workflows/build_image.yml | 27 ----------------------- 2 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/ansible.yml diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml new file mode 100644 index 0000000..a11427c --- /dev/null +++ b/.github/workflows/ansible.yml @@ -0,0 +1,36 @@ +name: Build Image + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: "20 4 * * 6" # saturday at 4.20 + workflow_dispatch: + + ansible: + runs-on: archlinux-latest + steps: + - name: Install ansible + run: | + pacman -Sy + pacman -S ansible + + - name: Setup local inventory + run: | + echo "localhost ansible_user=root connection=local" > ansible-hosts + + - name: Run playbook + run: | + ansible-playbook -i ansible-hosts playbook.yml + + - name: Notify on failure + if: failure() + run: | + python -m venv . + ./bin/pip install https://git.decapod.one/brethil/bretellofier + + ./bin/bretellofier "[brethil/dotfiles] 💥 Build failed" + env: + BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }} + BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}} diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 85115ae..904533a 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -39,30 +39,3 @@ jobs: env: BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }} BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}} - - ansible: - runs-on: archlinux-latest - steps: - - name: Install ansible - run: | - pacman -Sy - pacman -S ansible - - - name: Setup local inventory - run: | - echo "localhost ansible_user=root connection=local" > ansible-hosts - - - name: Run playbook - run: | - ansible-playbook -i ansible-hosts playbook.yml - - - name: Notify on failure - if: failure() - run: | - python -m venv . - ./bin/pip install https://git.decapod.one/brethil/bretellofier - - ./bin/bretellofier "[brethil/dotfiles] 💥 Build failed" - env: - BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }} - BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}}