Create monitor.yml

This commit is contained in:
dvirlabs 2025-06-27 15:48:23 +03:00 committed by GitHub
parent 1fb6893b11
commit c762de1267
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

29
.github/workflows/monitor.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Monitor Lab URLs
on:
schedule:
- cron: "*/5 * * * *" # Every 5 minutes
workflow_dispatch:
jobs:
monitor:
runs-on: ubuntu-latest
steps:
- name: Check Woodpecker URL
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://woodpecker.dvirlabs.com)
if [[ "$STATUS" == "502" ]]; then
curl -s \
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
--form-string "message=⚠️ Woodpecker is down (502)" \
https://api.pushover.net/1/messages.json
elif [[ "$STATUS" == "404" ]]; then
curl -s \
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
--form-string "message=❌ Woodpecker not found (404)" \
https://api.pushover.net/1/messages.json
else
echo "✅ All good: $STATUS"