supabase-action-example icon indicating copy to clipboard operation
supabase-action-example copied to clipboard

Should we push config.toml too?

Open tadeegan opened this issue 9 months ago • 3 comments

Improve documentation

A large amount of supabase functionallity is controlled by config.toml. If we want to manage a staging enviornment that mirrors the prod one, how can we push the config.toml with correct envs? Should we use supabase config push in ci?

So far I tried something like:

name: Deploy Migrations to Staging

on:
  push:
    branches:
      - develop
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest

    env:
      SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
      SUPABASE_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
      SUPABASE_PROJECT_ID: xxx
      DEPLOY_URL: staging.xxx.co

    steps:
      - uses: actions/checkout@v3

      - uses: supabase/setup-cli@v1
        with:
          version: latest

      - run: supabase link --project-ref $SUPABASE_PROJECT_ID
      - run: supabase db push
      - run: supabase config push

tadeegan avatar Feb 04 '25 00:02 tadeegan

Good question. I'm thinking this should also include supabase functions deploy

msacket avatar Apr 07 '25 16:04 msacket

Yup, you can commit config.toml to git and run supabase config push as well as supabase functions deploy.

Sometimes you also want to setup different configs for local and prod. In that case, you can declare the a separate remote. For eg.

[auth]
enable_signup = false

[remotes.prod]
project_id = "<prod-project-ref>"

[remotes.prod.auth]
enable_signup = true

This way when you link to production project on CI, the config in [remotes.prod] block will be pushed instead.

sweatybridge avatar Jul 22 '25 16:07 sweatybridge

Are there docs on how this remotes works? How do I name my project "prod"?

tadeegan avatar Jul 22 '25 17:07 tadeegan