Add supabase db migration workflows (#65)

* Add ci supabase workflows

* Fix unused db seeding
This commit is contained in:
Jared Schoeny
2026-07-07 12:29:16 -06:00
committed by GitHub
parent 6e17c5fbf6
commit 350d660936
3 changed files with 58 additions and 1 deletions

30
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: CI
on:
pull_request:
paths:
- 'supabase/**'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Start Supabase local development setup
run: supabase db start
- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > src/types/db.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet src/types/db.ts; then
echo "Detected uncommitted changes in src/types/db.ts after build. See status below:"
git diff
exit 1
fi

View File

@@ -0,0 +1,27 @@
name: Deploy Supabase Migrations to Production
on:
push:
branches: [main]
paths:
- 'supabase/migrations/**'
- 'supabase/config.toml'
workflow_dispatch:
jobs:
migrate:
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push

View File

@@ -57,7 +57,7 @@ schema_paths = []
[db.seed]
# If enabled, seeds the database after migrations during a db reset.
enabled = true
enabled = false
# Specifies an ordered list of seed files to load during db reset.
# Supports glob patterns relative to supabase directory: "./seeds/*.sql"
sql_paths = ["./seed.sql"]