Skip to content

Supabase - Run Migrations Step Template#1676

Open
itsmebenwalker wants to merge 2 commits intoOctopusDeploy:masterfrom
itsmebenwalker:bw/supabase-mig-community-step
Open

Supabase - Run Migrations Step Template#1676
itsmebenwalker wants to merge 2 commits intoOctopusDeploy:masterfrom
itsmebenwalker:bw/supabase-mig-community-step

Conversation

@itsmebenwalker
Copy link
Copy Markdown

@itsmebenwalker itsmebenwalker commented May 4, 2026

Background

This PR adds a new community step template for running Supabase database migrations as part of an Octopus Deploy deployment process.

There is currently no Supabase step template in the library. Teams using Supabase need a way to push schema migrations to their remote database during deployments without writing and maintaining a custom script from scratch.

image

Results

The Supabase - Run Migrations step template:

  1. Installs the Supabase CLI on the worker if not already present — using a direct binary download from GitHub releases (no npm or sudo required, works on Octopus hosted Ubuntu workers)
  2. Authenticates with Supabase using the SUPABASE_ACCESS_TOKEN environment variable (no interactive login required)
  3. Links to the specified Supabase project
  4. Pushes pending migrations to the remote database using supabase db push

The step expects a referenced package named supabase-migrations attached to the deployment step with Extract package enabled. The package must contain a supabase/migrations/ directory at its root. This is documented in the template description.

See public repo used to build/test this step.

Before

No Supabase migration step template existed in the library.

After

Successful deployment log:

Extracting dependency '/home/Octopus/Files/supabase-migrations@S1.15.0@a03ff0f.zip' to '/home/Octopus/Work/08dea9a7-725f-34e0-819f-c894a1866ed2/supabase-migrations' 
========================================== 
Supabase - Run Migrations 
========================================== 
Project Ref: etyuyjgzxnqxfenwjutt 
CLI Version: latest 
========================================== 
Supabase CLI not found. Installing... 
Installing Supabase CLI... 
Downloading Supabase CLI from GitHub releases... 
========================================== 
Authenticating with Supabase... 
========================================== 
Supabase workdir: /home/Octopus/Work/08dea9a7-725f-34e0-819f-c894a1866ed2/supabase-migrations 
Migrations folder exists: YES 
Linking Supabase project... 
Using workdir /home/Octopus/Work/08dea9a7-725f-34e0-819f-c894a1866ed2/supabase-migrations 
WARNING: Local database version differs from the linked project. 
Update your supabase/config.toml to fix it: 
[db] 
major_version = 17 
Finished supabase link. 
========================================== 
Running database migrations... 
========================================== 
Using workdir /home/Octopus/Work/08dea9a7-725f-34e0-819f-c894a1866ed2/supabase-migrations 
Connecting to remote database... 
Do you want to push these migrations to the remote database? 
 • 20240104000000_add_notifications_and_follows.sql 
 [Y/n]  
Applying migration 20240104000000_add_notifications_and_follows.sql... 
Finished supabase db push. 
========================================== 
Migration completed successfully! 
========================================== 
image image

Pre-requisites

  • Id is a valid GUID: 937be757-a954-42e3-b315-670578a346e0
  • Version is 1 — new template, no prior version to increment from
  • Parameter names do not start with $
  • Parameter names are prefixed with Supabase (SupabaseProjectRef, SupabaseDbPassword, SupabaseAccessToken, SupabaseCliVersion)
  • LastModifiedBy is set to itsmebenwalker
  • Best practices applied — parameter validation with exit 1, sensitive parameters marked as Sensitive, status messages throughout
  • New supabase category created — still needs:
    • supabase.png (200×200px) added to step-templates/logos/
    • case "supabase": added to the humanize function in gulpfile.babel.js

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 4, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Start Hyponome locally

docker pull ghcr.io/hnrkndrssn/hyponome:main
docker run --rm -p 8000:8080 -it ghcr.io/hnrkndrssn/hyponome:main

Review in Hyponome

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.

3 participants