Repository navigation
ci: query the database once a day so Supabase never pauses it - #15
Merged
Merged
Conversation
Supabase paused the free project on 2026-10-05 and the API crash-looped, because the entrypoint's migrate deploy could not reach the database. The docs assumed the nightly cron jobs kept it awake, but they run inside the API process and only fire if Render is awake at 02:00. A scheduled workflow now calls /health/ready once a day: one SELECT 1 from GitHub's scheduler, independent of Render and the uptime pinger. No checkout, no third-party actions, empty permissions. A failed run emails the owner, so it doubles as an early warning. Docs: deployment.md caveat and ADR 53 amended with what actually happened.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Supabase paused the free project on 2026-10-05 (about a week without database activity). The API then crash-looped:
docker-entrypoint.shrunsprisma migrate deployfirst, and that failed against the paused database.The docs said the nightly cron jobs (02:00 overdue check, 03:00 demo reset) keep the database awake. They run inside the API process with
node-cron, so they only fire if Render's instance is awake at that moment — a dependency nobody had written down.What
.github/workflows/keep-database-awake.yml— once a day (07:23 UTC)curlcalls/health/ready, which runsSELECT 1. It runs on GitHub's scheduler, so it does not depend on Render or UptimeRobot.permissions: {}--max-time 90covers Render's cold start; 3 retries;--failso a 503 fails the run, and GitHub emails the failuredocs/deployment.mdand ADR 53 amended with what actually happenedCost
Supabase's free database runs 24/7 whether it is queried or not, so one
SELECT 1a day uses nothing that counts. This does not repeat the Neon problem from ADR 51 — that was a query every few seconds against an hourly compute quota. GitHub Actions minutes are free for public repos.Verified
curlcommand run against the live API:{"status":"ready","database":"up","redis":"up"}, exit 0run:line is that same single command