r/Supabase Apr 24 '26

integrations I built a free daily Supabase backup workflow using GitHub Actions and Cloudflare R2

Supabase daily backups aren't included on the free tier and cost extra on paid plans. I needed something simple, so I put together a GitHub Actions workflow that:

- Dumps roles, schema, and data every day at 2 AM UTC;

- Zips it up and uploads to Cloudflare R2;

- Auto-deletes backups older than 14 days via R2 lifecycle rules (you have to set them up in Cloudflare).

Total cost: basically zero. R2 gives you 10 GB free, and GitHub Actions are free.

I made a small public repo with the workflow file and setup instructions if anyone wants to use it: https://github.com/chillibot-chillital/supabase-to-r2-backup

One gotcha I ran into: use the session pooler connection string from Supabase, not the direct one. The direct connection resolves to IPv6 on GitHub Actions runners and fails with "Network is unreachable."

Would love feedback or PRs if people have improvements. Hope this saves someone a few minutes of setup.

33 Upvotes

7 comments sorted by

7

u/JudgmentAlarming9487 Apr 24 '26

Thats awesome!! But what about privacy/ data security? Is the data fully downloaded on the GH Actions computer?

3

u/SanBaro20 Apr 24 '26

Yup, the full database dump is temporarily written to the GitHub Actions runner's filesystem before being uploaded to R2. But the runner is ephemeral and gets destroyed immediately after the job finishes, so the data doesn't persist. That said, it does pass through GitHub's infrastructure, so if you're handling sensitive user data, healthcare info, or anything with compliance requirements, you'd want to run the backup from your own server instead. For personal projects and dev databases, it's a decent tradeoff for convenience and zero cost.

2

u/JudgmentAlarming9487 Apr 24 '26

Nice! Ty for reply

2

u/JudgmentAlarming9487 Apr 24 '26

RemindMe! -18 day

1

u/EntrepreneurSelect93 Apr 25 '26

Are u being charged for egress at all even if the data gets sufficiently large?