-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (45 loc) · 1.59 KB
/
supabase-tests-pull-request.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Supabase checks
on:
push:
paths:
# Only run the workflow when changes are made to the migrations directory
- "apps/chat-with-pdf/supabase/migrations/**"
branches:
- "feature/**"
workflow_dispatch:
jobs:
test:
name: Supabase tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Init Supabase local development setup
run: supabase init
- name: Start Supabase local development setup
run: supabase start
- name: Run Supabase lint locally
run: supabase db lint
- name: Run Supabase tests locally
run: supabase test db
push:
name: Push to Supabase
needs: test
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_PROJECT_ID: ${{ github.base_ref == 'main' && secrets.SUPABASE_PROD_PROJECT_ID || secrets.SUPABASE_STAGING_PROJECT_ID }}
SUPABASE_DB_PASSWORD: ${{ github.base_ref == 'main' && secrets.SUPABASE_PROD_DB_PASSWORD || secrets.SUPABASE_STAGING_DB_PASSWORD }}
SUPABASE_AUTH_GITHUB_CLIENT_ID: ${{ secrets.SUPABASE_AUTH_GITHUB_CLIENT_ID }}
SUPABASE_AUTH_GITHUB_SECRET: ${{ secrets.SUPABASE_AUTH_GITHUB_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase link --project-ref $SUPABASE_PROJECT_ID --debug
working-directory: apps/chat-with-pdf
- run: supabase db push
working-directory: apps/chat-with-pdf