-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (23 loc) · 1.05 KB
/
Copy pathkeepalive.yml
File metadata and controls
26 lines (23 loc) · 1.05 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
name: keep-streamlit-awake
# Streamlit Community Cloud (free tier) sleeps an app after ~12h of no traffic, so the
# next visitor hits a "wake up" screen + a cold start. This pings the app's health
# endpoint every few hours to keep the container warm for public viewers.
# Note: this lightly bends the free tier's intent; the fully-professional path is a small
# always-on host (see the README). Best-effort — Streamlit may still recycle the container.
on:
schedule:
- cron: "23 */6 * * *" # every ~6 hours, off-the-hour on purpose
workflow_dispatch: {}
permissions:
contents: read
jobs:
ping:
runs-on: ubuntu-latest
steps:
- name: Wake / keep the app warm
run: |
APP="https://tfl-data-engineering.streamlit.app"
# Health endpoint returns "ok" when the app is serving; also hit root to trigger a wake.
curl -fsS --retry 5 --retry-all-errors --max-time 60 "$APP/_stcore/health" || true
curl -fsS --retry 5 --retry-all-errors --max-time 60 "$APP/" -o /dev/null || true
echo "pinged $APP"