-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (27 loc) · 1.08 KB
/
Copy pathkeepalive.yml
File metadata and controls
30 lines (27 loc) · 1.08 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
27
28
29
30
name: Supabase Database Keepalive
on:
schedule:
# Run every 3 days at 04:00 UTC
- cron: '0 4 */3 * *'
workflow_dispatch: # Allows manual trigger from GitHub UI
jobs:
keepalive:
name: Ping Database Keepalive
runs-on: ubuntu-latest
steps:
- name: Health Check Ping
run: |
if [ -n "${{ secrets.APP_URL }}" ]; then
echo "Pinging health endpoint at ${{ secrets.APP_URL }}/api/health..."
curl -s -f "${{ secrets.APP_URL }}/api/health" || echo "Warning: Health endpoint returned non-200"
else
echo "APP_URL secret not set. Skipping HTTP ping."
fi
- name: Direct DB Keepalive Query (if DATABASE_URL provided)
if: "${{ env.DATABASE_URL != '' }}"
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
echo "Executing lightweight keepalive query..."
# Uses psql with SSL mode to perform a lightweight query that resets Supabase pause timer
psql "$DATABASE_URL" -c "SELECT 1 as keepalive_ping;" || echo "Warning: Direct query failed"