-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
31 lines (28 loc) · 961 Bytes
/
health-check.yml
File metadata and controls
31 lines (28 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Health Check
on:
schedule:
- cron: '*/15 * * * *'
workflow_dispatch:
jobs:
check:
name: Check endpoints
runs-on: ubuntu-latest
steps:
- name: Check frontend (apexcharts.com)
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://apexcharts.com)
echo "Frontend status: $STATUS"
if [ "$STATUS" -lt 200 ] || [ "$STATUS" -ge 500 ]; then
echo "Frontend is DOWN (HTTP $STATUS)"
exit 1
fi
- name: Check backend (/health)
run: |
RESPONSE=$(curl -s --max-time 10 https://api.apexcharts.com/health)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://api.apexcharts.com/health)
echo "Backend status: $STATUS"
echo "Backend response: $RESPONSE"
if [ "$STATUS" != "200" ]; then
echo "Backend is DOWN (HTTP $STATUS)"
exit 1
fi