Skip to content

Commit 5b62191

Browse files
toto-castaldiclaude
andcommitted
fix(ci): add database migrations to deploy pipeline
- Add deploy-migrations job that runs supabase db push - Migrations run before Edge Functions deployment - Required for users and user_api_keys tables 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3539c8f commit 5b62191

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/ci-deploy.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,33 @@ jobs:
177177
key: ${{ secrets.DO_SSH_KEY }}
178178
script: sudo systemctl reload nginx
179179

180-
deploy-functions:
180+
deploy-migrations:
181181
runs-on: ubuntu-latest
182182
needs: release
183183
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
184+
steps:
185+
- uses: actions/checkout@v4
186+
with:
187+
ref: main
188+
189+
- uses: supabase/setup-cli@v1
190+
with:
191+
version: latest
192+
193+
- name: Link Supabase project
194+
run: supabase link --project-ref ${{ secrets.SUPABASE_PROJECT_REF }}
195+
env:
196+
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
197+
198+
- name: Run database migrations
199+
run: supabase db push
200+
env:
201+
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
202+
203+
deploy-functions:
204+
runs-on: ubuntu-latest
205+
needs: [release, deploy-migrations]
206+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
184207
steps:
185208
- uses: actions/checkout@v4
186209
with:

0 commit comments

Comments
 (0)