Skip to content

Commit 54df0a7

Browse files
AryanBVclaude
andcommitted
ci: Add GitHub Actions workflow to keep Supabase database alive
Prevents free-tier Supabase project from auto-pausing after 7 days of inactivity by pinging the database every 5 days. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3924e43 commit 54df0a7

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/keep-alive.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Keep Supabase Alive
2+
3+
on:
4+
schedule:
5+
# Runs every 5 days at midnight UTC
6+
- cron: '0 0 */5 * *'
7+
workflow_dispatch: # Allows manual trigger from GitHub UI
8+
9+
jobs:
10+
ping-database:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Ping Supabase Keep-Alive Endpoint
14+
run: |
15+
response=$(curl -s -w "\n%{http_code}" "https://waowoznsvaosgcgiivzo.supabase.co/functions/v1/keep-alive")
16+
http_code=$(echo "$response" | tail -n1)
17+
body=$(echo "$response" | head -n -1)
18+
19+
echo "Response: $body"
20+
echo "HTTP Status: $http_code"
21+
22+
if [ "$http_code" -ne 200 ]; then
23+
echo "Failed to ping database"
24+
exit 1
25+
fi
26+
27+
echo "Database pinged successfully!"

0 commit comments

Comments
 (0)