Skip to content

Commit e44262f

Browse files
authored
Add keep-warm workflow: ping veripsa.com so the free-tier web service doesn't cold-start (#4)
1 parent 89f9da4 commit e44262f

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/keep-warm.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: keep-warm
2+
3+
# Pings veripsa.com so the Render free-tier web service does not sleep — a slept
4+
# service cold-starts in ~10s, which is what makes the site feel slow. This repo
5+
# is public, so Actions minutes are unlimited (free). GitHub's scheduled runs can
6+
# be delayed under load, so we ping every 5 min to stay comfortably under Render's
7+
# ~15 min idle-sleep threshold. Zero secrets; just an outbound GET to a health URL.
8+
9+
on:
10+
schedule:
11+
- cron: "*/5 * * * *"
12+
workflow_dispatch: {}
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
ping:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 2
21+
steps:
22+
- name: Ping health endpoint
23+
run: |
24+
for attempt in 1 2 3; do
25+
code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 40 https://veripsa.com/api/healthz || echo "000")
26+
echo "attempt $attempt: HTTP $code"
27+
[ "$code" = "200" ] && exit 0
28+
sleep 10
29+
done
30+
echo "keep-warm ping did not get 200 after 3 attempts (service may be waking)"

0 commit comments

Comments
 (0)