-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.2 KB
/
supabase-ci-production.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: roll out supabase migration
on:
push:
branches:
- main
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
# Retrieve <project-id> from dashboard url: https://app.supabase.com/project/<project-id>
PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
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 start
- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > src/types/database-generated.types.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet ./src/types/database-generated.types.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
deploy-migrations:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
- run: supabase link --project-ref $PROJECT_ID
- run: supabase db push