Skip to content

Commit 80cb5d4

Browse files
committed
feat: add /health endpoint and GitHub Actions uptime monitor
1 parent c3db6dd commit 80cb5d4

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/health-check.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Health Check
2+
3+
on:
4+
schedule:
5+
- cron: '*/15 * * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
name: Check endpoints
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check frontend (apexcharts.com)
14+
run: |
15+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://apexcharts.com)
16+
echo "Frontend status: $STATUS"
17+
if [ "$STATUS" -lt 200 ] || [ "$STATUS" -ge 500 ]; then
18+
echo "Frontend is DOWN (HTTP $STATUS)"
19+
exit 1
20+
fi
21+
22+
- name: Check backend (/health)
23+
run: |
24+
RESPONSE=$(curl -s --max-time 10 https://api.apexcharts.com/health)
25+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://api.apexcharts.com/health)
26+
echo "Backend status: $STATUS"
27+
echo "Backend response: $RESPONSE"
28+
if [ "$STATUS" != "200" ]; then
29+
echo "Backend is DOWN (HTTP $STATUS)"
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)