Skip to content

Commit

Permalink
feat: supabase ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
JappyMondo committed Jun 16, 2024
1 parent 6da88d2 commit 76b16df
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
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: ${{ vars.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

0 comments on commit 76b16df

Please sign in to comment.