diff --git a/.github/workflows/supabase-migrations.yml b/.github/workflows/supabase-migrations.yml new file mode 100644 index 0000000..285eb74 --- /dev/null +++ b/.github/workflows/supabase-migrations.yml @@ -0,0 +1,34 @@ +name: Supabase Migrations + +on: + pull_request: + branches: [main] + paths: + - "supabase/**" + - ".github/workflows/supabase-migrations.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: supabase-migrations-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + validate: + name: Validate migrations + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Supabase CLI + uses: supabase/setup-cli@v1 + with: + version: 2.114.0 + + - name: Apply migrations to a clean local database + run: supabase db start