30 lines
1015 B
YAML
30 lines
1015 B
YAML
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"
|