|
Hi, I'm setting up a CD-pipeline in Github actions to deploy to production using When doing so the cli picks up the config.toml which causes some error as it has been setup to be used for the local environment. Any ideas how to handle this? Thank you! |
Replies: 2 comments 2 replies
|
Clarification: [auth.hook.send_email]
enabled = true
uri = "http://host.docker.internal:3000/api/auth/email-webhook" #host.docker.internal is a special DNS name used in Docker to allow a container to access the host machine's network. This allows the Auth container to reach the route handler
secrets = "env(SUPABASE_SEND_EMAIL_HOOK_SECRET)"This works perfectly fine and does exactly what i want it to do when running the Supabase stack on my local machine. The SUPABASE_SEND_EMAIL_HOOK_SECRET-secret is in my .env file which is not tracked by git. So far so good. The problem: The pipeline will fail with the following message: The explanation: However, I kind of don't like the idea of this. It feels like there must be a better way of handling this. Seems dangerous that the production CD tries to read the configs from my file for local environment config even though I assume it wouldn't use it. I hope this clarified things. Thank you for wanting to help! |
|
For anyone else finding this in the future: The CLI (regardless of being run locally or in a CD-pipeline) requires a config.toml-file. It also validates the content (hence the error). This is true regardless of the CI-command you're running needs any configuration ( You basically have 3 options. Option 1 - Option 2 - The config.toml file will now be valid and will pass validation Option 3 - I hope that helped! |
For anyone else finding this in the future:
The CLI (regardless of being run locally or in a CD-pipeline) requires a config.toml-file. It also validates the content (hence the error). This is true regardless of the CI-command you're running needs any configuration (
supabase db pushdoesn't).You basically have 3 options.
Option 1 -
In your CD-pipeline just programatically overwrite your checked in config.toml with a config.toml that will pass validation (I think an empty one will do).
Option 2 -
Declare the SUPABASE_SEND_EMAIL_HOOK_SECRET as a secret in Github and pick it up in your .yml-file :
env:
SUPABASE_SEND_EMAIL_HOOK_SECRET: ${{ secrets. SUPABASE_SEND_EMAIL_HOOK_SECRET }}The confi…