Skip to content

Commit

Permalink
Create restore-db
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng authored Oct 25, 2023
1 parent 3962d5b commit 1d339df
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/restore-db
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Supa-restore

on:
push:
branches: [ restore ]
workflow_dispatch:

jobs:
run_db_restore:
runs-on: ubuntu-latest
permissions:
contents: write

env:
supabase_db_url: ${{ secrets.SUPABASE_RESTORE_DB_URL }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: supabase/setup-cli@v1
with:
version: latest

- name: Install PostgreSQL client
run: sudo apt-get install -y postgresql-client

- name: Restore database dump to Supabase
run: |
PGPASSWORD=${{ secrets.SUPABASE_DB_PASSWORD }} psql -h db.mtzoltkenufqksfcwqtn.supabase.co -p 5432 -d postgres -U postgres < schema.sql
PGPASSWORD=${{ secrets.SUPABASE_DB_PASSWORD }} psql -h db.mtzoltkenufqksfcwqtn.supabase.co -p 5432 -d postgres -U postgres < data.sql
env:
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}

0 comments on commit 1d339df

Please sign in to comment.