Skip to content

Commit

Permalink
db: github action
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboesquivel committed Jan 29, 2024
1 parent 90d8586 commit 546ccf8
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions .github/workflows/supabase-migrations.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
name: Supabase Migrations
name: Release

on:
push:
branches:
- main # Adjust this to your main development branch
paths:
- 'apps/supabase/**' # Adjust this path to where your Supabase project is located in the monorepo
- main
workflow_dispatch:

jobs:
deploy:
release:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Install Supabase CLI
run: |
curl -L https://github.com/supabase/cli/releases/latest/download/supabase_linux -o /tmp/supabase
chmod +x /tmp/supabase
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.PRODUCTION_PROJECT_ID }}

- name: Link Supabase Project
run: /tmp/supabase link --project-ref kvdrzfyetdzigjkmgwgn --anon-key "$SUPABASE_ANON_KEY" --service-role-key "$SUPABASE_SERVICE_ROLE_KEY"
env:
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
working-directory: ./apps/supabase
steps:
- uses: actions/checkout@v3

- name: Deploy Edge Functions
run: /tmp/supabase functions deploy --env production
working-directory: ./apps/supabase
- uses: supabase/setup-cli@v1
with:
version: latest

- name: Run DB Migrations
run: /tmp/supabase db push --env production
working-directory: ./apps/supabase
- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push

0 comments on commit 546ccf8

Please sign in to comment.