Skip to content

Commit

Permalink
supabase schema deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
JappyMondo committed Jun 9, 2024
1 parent 5e307a5 commit b98309c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/supabase.migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy Supabase Migrations to Production

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
environment: production
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@v3

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

- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
28 changes: 28 additions & 0 deletions .github/workflows/supabase.types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Supabase types

on:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- 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 > types.gen.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet types.gen.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"postinstall": "cpy --flat ./node_modules/framework7-icons/fonts/*.* ./src/fonts/ && cpy --flat ./node_modules/material-icons/iconfont/*.* ./src/fonts/",
"assets:ui": "framework7 assets --ui",
"supabase": "supabase",
"supabase:types": "supabase gen types typescript --local > src/types/supabase.ts"
"supabase:types": "supabase gen types typescript --local > src/types/supabase.ts",
"supabase:diff": "supabase db diff -f"
},
"browserslist": [
"IOS >= 15",
Expand Down

0 comments on commit b98309c

Please sign in to comment.