Files
infra-meraki/.gitea/workflows/deploy.yaml
Luke Tainton f67a991129
All checks were successful
Deploy / deploy (push) Successful in 37s
feat: enhance deployment notifications with detailed messages and log links
2026-03-13 21:32:59 +00:00

81 lines
2.5 KiB
YAML

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Notify Start
if: always()
uses: https://git.tainton.uk/actions/pushover-action@v1.1.5
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
title: "Meraki Config Deploy Started"
message: "Meraki configuration deployment has started."
sound: "pushover"
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}"
url_title: 'View Logs'
- name: Check out repository code
uses: actions/checkout@v6.0.2
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: uv cache
uses: actions/cache@v5
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: uv sync
- name: Run Ansible
run: |
MERAKI_DASHBOARD_API_KEY=${{ secrets.MERAKI_DASHBOARD_API_KEY }} \
WIFI_PSK=${{ secrets.WIFI_PSK }} \
uv run ansible-playbook -i hosts config.yaml
- name: Minimize uv cache
run: uv cache prune --ci
- name: Notify Success
if: success()
uses: https://git.tainton.uk/actions/pushover-action@v1.1.5
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
title: "Meraki Configuration Deploy"
message: "Meraki configuration deployed successfully!"
sound: "classical"
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}"
url_title: 'View Logs'
- name: Notify Failure
if: failure()
uses: https://git.tainton.uk/actions/pushover-action@v1.1.5
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
title: "Meraki Configuration Deploy"
message: "Meraki configuration FAILED to deploy!"
sound: "mechanical"
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}"
url_title: 'View Logs'