Deploying with CI / CD pipelines
Use GitHub Actions, Bitbucket, and GitLab CI to deploy your Edge Functions.
You can use popular CI / CD tools like GitHub Actions, Bitbucket, and GitLab CI to automate Edge Function deployments.
GitHub Actions
You can use the official setup-cli
GitHub Action to run Supabase CLI commands in your GitHub Actions.
The following GitHub Action deploys all Edge Functions any time code is merged into the main
branch:
_24name: Deploy Function_24_24on:_24 push:_24 branches:_24 - main_24 workflow_dispatch:_24_24jobs:_24 deploy:_24 runs-on: ubuntu-latest_24_24 env:_24 SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}_24 PROJECT_ID: your-project-id_24_24 steps:_24 - uses: actions/checkout@v3_24_24 - uses: supabase/setup-cli@v1_24 with:_24 version: latest_24_24 - run: supabase functions deploy --project-ref $PROJECT_ID
GitLab CI
Here is the sample pipeline configuration to deploy via GitLab CI.
_29image: node:20_29_29# List of stages for jobs, and their order of execution_29stages:_29 - setup_29 - deploy_29_29# This job runs in the setup stage, which runs first._29setup-npm:_29 stage: setup_29 script:_29 - npm i supabase_29 cache:_29 paths:_29 - node_modules/_29 artifacts:_29 paths:_29 - node_modules/_29_29# This job runs in the deploy stage, which only starts when the job in the build stage completes successfully._29deploy-function:_29 stage: deploy_29 script:_29 - npx supabase init_29 - npx supabase functions deploy --debug_29 services:_29 - docker:dind_29 variables:_29 DOCKER_HOST: tcp://docker:2375
Bitbucket Pipelines
Here is the sample pipeline configuration to deploy via Bitbucket.
_18image: node:20_18_18pipelines:_18 default:_18 - step:_18 name: Setup_18 caches:_18 - node_18 script:_18 - npm i supabase_18 - parallel:_18 - step:_18 name: Functions Deploy_18 script:_18 - npx supabase init_18 - npx supabase functions deploy --debug_18 services:_18 - docker
Declarative configuration
Individual function configuration like JWT verification and import map location can be set via the config.toml
file.
_10[functions.hello-world]_10verify_jwt = false
Resources
- See the example on GitHub.