Skip to content

Automatic supabase db push github action - #47

Open
bastislack wants to merge 1 commit into
devfrom
gh-action
Open

Automatic supabase db push github action#47
bastislack wants to merge 1 commit into
devfrom
gh-action

Conversation

@bastislack

Copy link
Copy Markdown
Collaborator

This action is only triggered when new db migrations are merged in master.

Migrations were applied to prod by hand, so the deployed schema drifted
from `supabase/migrations/` without anything noticing — `20260803120000`
(the widened consistency constraint the legacy import needs) is still
missing on prod while its code sits merged on dev.

A push to master touching `supabase/migrations/**` now links the project
and runs `db push`, printing `migration list` before and after so the run
log shows what was pending and that nothing is left.

Scoped to `migrations/**`: `supabase/schemas/` is declarative source that
`db push` never reads, so a schema edit without its generated migration
deploys nothing. No `--include-all`, which keeps the out-of-order files in
`supabase/legacy/` unpushed and leaves `00000000000000_initial_schema`
alone (already marked applied on prod).

Needs SUPABASE_ACCESS_TOKEN, SUPABASE_DB_PASSWORD and SUPABASE_PROJECT_ID
as repo secrets. The `production` environment is created on first run
without protection; add required reviewers there for a gate before DDL.
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for lively-torte-533cc3 ready!

Name Link
🔨 Latest commit 23cb3cd
🔍 Latest deploy log https://app.netlify.com/projects/lively-torte-533cc3/deploys/6a7b30b05d244a00086a3890
😎 Deploy Preview https://deploy-preview-47--lively-torte-533cc3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bastislack

Copy link
Copy Markdown
Collaborator Author

@Jmangles For this gh-action we need the SUPABASE_DB_PASSWORD secret. Since I don't know the pw, can you add that secret?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant