backup-database #1
This file contains 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
name: 'backup-database' | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
supabase_db_url: postgres://postgres.qpfpqzjzriwrmtnwawit:[email protected]:5432/postgres # For example: postgresql://postgres:[YOUR-PASSWORD]@db.<ref>.supabase.co:5432/postgres | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- name: Backup roles | |
run: supabase db dump --db-url "$supabase_db_url" -f roles.sql --role-only | |
- name: Backup schema | |
run: supabase db dump --db-url "$supabase_db_url" -f schema.sql | |
- name: Backup data | |
run: supabase db dump --db-url "$supabase_db_url" -f data.sql --data-only --use-copy |