feat: schedule 6h backup via GitHub Actions instead of Vercel cron

This commit is contained in:
Christian Vidal Wolf
2026-05-15 08:10:39 +02:00
parent b911ada50b
commit f66295f07b
2 changed files with 29 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
name: Supabase Backup to Dropbox
on:
schedule:
- cron: '0 0,6,12,18 * * *' # every 6h at 00:00, 06:00, 12:00, 18:00 UTC
workflow_dispatch: # allow manual trigger from GitHub UI
jobs:
backup:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Trigger backup endpoint
run: |
RESPONSE=$(curl -s -w "\n%{http_code}" \
-X GET \
-H "Authorization: Bearer ${{ secrets.BACKUP_SECRET }}" \
https://craze-data-check.vercel.app/api/backup)
HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | head -n-1)
echo "Status: $HTTP_STATUS"
echo "Response: $BODY"
if [ "$HTTP_STATUS" != "200" ]; then
echo "Backup failed with status $HTTP_STATUS"
exit 1
fi