From 81fa97520ca7ead34c1a4862cdafdbdd2caea27c Mon Sep 17 00:00:00 2001 From: bretello Date: Fri, 5 Jul 2024 22:11:40 +0200 Subject: [PATCH] gha: add ansible run workflow --- .github/workflows/build_image.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 904533a..85115ae 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -39,3 +39,30 @@ 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}}