Files
daily-blackout-check/.gitea/workflows/check.yml
Meghdad 308ed80ff4
Some checks failed
Test blackout notifier / test (push) Failing after 0s
Hourly blackout check / check (push) Failing after 0s
Build runner image / build (push) Failing after 2s
Publish runner image to Gitea Container Registry
2026-07-17 20:22:52 +03:30

48 lines
1.4 KiB
YAML

name: Hourly blackout check
on:
schedule:
- cron: "@hourly"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
container:
image: mahgit.ir/meghdadfadaee/daily-blackout-check-runner:latest
credentials:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
env:
PYTHONPATH: src
steps:
- name: Check out repository
uses: https://gitea.com/actions/checkout@v4
with:
fetch-depth: 0
- name: Check outages and persist state
env:
BARGHEMAN_TOKEN: ${{ secrets.BARGHEMAN_TOKEN }}
EITAAYAR_TOKEN: ${{ secrets.EITAAYAR_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
BILL_IDS: ${{ secrets.BILL_IDS }}
STATE_FILE: state/outages.json
run: |
set +e
python -m blackout_notifier check
checker_status=$?
set -e
if ! git diff --quiet -- state/outages.json; then
git config user.name "gitea-blackout-bot"
git config user.email "blackout-bot@mahgit.ir"
git add state/outages.json
git commit -m "chore(state): update outage notification state [skip ci]"
branch="$(git branch --show-current)"
git pull --rebase origin "$branch"
git push origin "$branch"
fi
exit "$checker_status"