-
Notifications
You must be signed in to change notification settings - Fork 7
43 lines (35 loc) · 1.16 KB
/
keep-alive.yml
File metadata and controls
43 lines (35 loc) · 1.16 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
name: Keep Render Service Alive
on:
schedule:
# Run every 10 minutes
- cron: '*/10 * * * *'
workflow_dispatch: # Allow manual trigger
jobs:
keep-alive:
runs-on: ubuntu-latest
env:
API_URL: ${{ secrets.API_URL }}
steps:
- name: Ping API Health Endpoint
run: |
echo "Pinging API to keep service awake..."
response=$(curl -s -o /dev/null -w "%{http_code}" ${API_URL}/api/health)
if [ $response -eq 200 ]; then
echo "✅ Service is alive (HTTP $response)"
else
echo "⚠️ Service returned HTTP $response"
exit 1
fi
- name: Check Response Time
run: |
echo "Checking API response time..."
start=$(date +%s%N)
curl -s ${API_URL}/api/health > /dev/null
end=$(date +%s%N)
duration=$((($end - $start) / 1000000))
echo "Response time: ${duration}ms"
if [ $duration -lt 5000 ]; then
echo "✅ Fast response (<5s)"
else
echo "⚠️ Slow response (${duration}ms) - may be cold start"
fi