Skip to content

Commit

Permalink
Add GitHub workflow for infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoc-quoc-huynh committed Sep 20, 2024
1 parent 32c96a6 commit 2c203ff
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/infrastructure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: infrastructure

on:
push:
branches:
- main
paths:
- 'infrastructure/**'
- '.github/workflows/infrastructure.yaml'
workflow_dispatch:

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_ID: ${{ vars.PROJECT_ID }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}

defaults:
run:
working-directory: ./infrastructure

jobs:
check:
runs-on: ubuntu-latest
if: github.event_name != 'workflow_dispatch'

steps:
- uses: actions/checkout@v4

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

- name: Setup Supabase
run: |
supabase login --token $SUPABASE_ACCESS_TOKEN
supabase link --project-ref $PROJECT_ID
supabase db start
- name: Run Tests
run: supabase db test

deploy:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'

steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest

- name: Setup Supabase
run: |
supabase login --token $SUPABASE_ACCESS_TOKEN
supabase link --project-ref $PROJECT_ID
supabase db start
- name: Run Tests
run: supabase db test
- name: Deploy Database
run: supabase db push --include-seed

0 comments on commit 2c203ff

Please # to comment.