Create monitor.yml
This commit is contained in:
parent
1fb6893b11
commit
c762de1267
29
.github/workflows/monitor.yml
vendored
Normal file
29
.github/workflows/monitor.yml
vendored
Normal 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"
|
||||||
Loading…
x
Reference in New Issue
Block a user