-
Notifications
You must be signed in to change notification settings - Fork 116
74 lines (60 loc) · 2.26 KB
/
on_pull_request_supabase.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Supabase PR Check
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
on-pull-request-supabase:
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_STAGING_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_STAGING_PROJECT_ID }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 20.5
uses: actions/setup-node@v4
with:
node-version: 20.5.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Load Yarn cache
uses: actions/cache@v3
id: yarn_cache_id
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Node modules cache
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: steps.yarn_cache_id.outputs.cache-hit != 'true' || steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn install --immutable
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Link Supabase project
run: yarn workspace @twilio-paste/backend supabase link --project-ref $SUPABASE_PROJECT_ID
- name: Run migrations on staging
run: yarn workspace @twilio-paste/backend supabase db push
- name: Start Supabase local development setup
run: yarn start:backend:dev
- name: Verify generated types are checked in
run: |
yarn generate:db-types
if ! git diff --ignore-space-at-eol --exit-code --quiet apps/backend/supabase/schema.gen.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi