Skip to content

Commit 6264546

Browse files
authored
Create monitoring.yml
1 parent 4038abc commit 6264546

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/monitoring.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Monitoring Heartbeat
2+
3+
on:
4+
schedule:
5+
- cron: '*/15 * * * *' # every 15 min
6+
7+
jobs:
8+
ping:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check prod health
12+
run: |
13+
STATUS=$(curl -s -o /dev/null -w '%{http_code}' https://api.ai-eyes.com/health)
14+
if [ "$STATUS" != "200" ]; then
15+
echo "Prod health-check failed"
16+
exit 1
17+
fi
18+
- name: Notify Slack on failure
19+
if: failure()
20+
uses: 8398a7/action-slack@v3
21+
with:
22+
status: ${{ job.status }}
23+
author_name: GitHub Actions (heartbeat)
24+
fields: repo,commit
25+
env:
26+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)