REST root ping + cheap table/rpc query with the anon key, retries with backoff, job summary, early warnings (stale last success, weekly cron, GitHub 60-day schedule disable), copy-paste workflow examples and a curl-only fallback. Self-test workflow runs against a real endpoint. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
26 lines
948 B
YAML
26 lines
948 B
YAML
# Copy to .github/workflows/keep-alive.yml in any repository.
|
|
# Add two repository secrets: SUPABASE_URL and SUPABASE_ANON_KEY
|
|
# (Settings -> Secrets and variables -> Actions).
|
|
name: Keep Supabase alive
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "17 6 * * *" # daily, 06:17 UTC; avoid :00 (GitHub's busiest minute)
|
|
workflow_dispatch: # lets you run it by hand from the Actions tab
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read # lets the action read its own previous runs for the early warning
|
|
|
|
jobs:
|
|
ping:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: caelum0x/supabase-keep-alive-action@v1
|
|
with:
|
|
url: ${{ secrets.SUPABASE_URL }}
|
|
anon-key: ${{ secrets.SUPABASE_ANON_KEY }}
|
|
# one of these makes a real database query run (recommended):
|
|
table: keepalive # any small table; RLS with no anon policy is fine
|
|
# rpc: keepalive_ping # or a tiny function, see README
|