CI / CD Workflow

As described in the Supabase CLI Environments Guide, you can use the setup-cli GitHub Action to run Supabase CLI commands in your GitHub Actions, for example to deploy a Supabase Edge Function:

1name: Deploy Function
2
3on:
4  push:
5    branches:
6      - main
7  workflow_dispatch:
8
9jobs:
10  deploy:
11    runs-on: ubuntu-latest
12
13    env:
14      SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
15      PROJECT_ID: zdtdtxajzydjqzuktnqx
16
17    steps:
18      - uses: actions/checkout@v3
19
20      - uses: supabase/setup-cli@v1
21        with:
22          version: 1.0.0
23
24      - run: supabase functions deploy your-function-name --project-ref $PROJECT_ID

See the example on GitHub.