From 90d8586f2dd39ecc2925b840b28eaf437d39d877 Mon Sep 17 00:00:00 2001 From: Gabo Esquivel Date: Mon, 29 Jan 2024 01:15:53 -0600 Subject: [PATCH] chore: test github migration action --- .github/workflows/supabase-migrations.yml | 39 ++++++++++++----------- apps/supabase/test-migration | 1 + 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 apps/supabase/test-migration diff --git a/.github/workflows/supabase-migrations.yml b/.github/workflows/supabase-migrations.yml index fff2af6b..a8ff80f9 100644 --- a/.github/workflows/supabase-migrations.yml +++ b/.github/workflows/supabase-migrations.yml @@ -3,33 +3,34 @@ name: Supabase Migrations on: push: branches: - - main # or your default branch + - main # Adjust this to your main development branch paths: - - 'apps/supabase/**' # Trigger only when there are changes in the Supabase app + - 'apps/supabase/**' # Adjust this path to where your Supabase project is located in the monorepo jobs: - run-migrations: + deploy: runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v2 # Ensure this is the latest version + - name: Check out repo + uses: actions/checkout@v2 - - name: Set up Node.js 20 - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Download Supabase CLI + - name: Install Supabase CLI run: | - curl -L https://github.com/supabase/cli/releases/latest/download/supabase_linux_amd64 -o supabase - chmod +x supabase + curl -L https://github.com/supabase/cli/releases/latest/download/supabase_linux -o /tmp/supabase + chmod +x /tmp/supabase - - name: Run Supabase Migrations - run: | - ./supabase link --project-ref kvdrzfyetdzigjkmgwgn --anon-key "$ANON_KEY" --service-role-key "$SERVICE_ROLE_KEY" - ./supabase db push + - name: Link Supabase Project + run: /tmp/supabase link --project-ref kvdrzfyetdzigjkmgwgn --anon-key "$SUPABASE_ANON_KEY" --service-role-key "$SUPABASE_SERVICE_ROLE_KEY" env: - ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} - SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} + SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} + SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} + working-directory: ./apps/supabase + + - name: Deploy Edge Functions + run: /tmp/supabase functions deploy --env production + working-directory: ./apps/supabase + + - name: Run DB Migrations + run: /tmp/supabase db push --env production working-directory: ./apps/supabase diff --git a/apps/supabase/test-migration b/apps/supabase/test-migration new file mode 100644 index 00000000..30d74d25 --- /dev/null +++ b/apps/supabase/test-migration @@ -0,0 +1 @@ +test \ No newline at end of file