SU

supabase-ci-integration

Configures GitHub Actions to automate Supabase project linking, database migrations, and integration testing.

Install

mkdir -p .claude/skills/supabase-ci-integration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1799" && unzip -o skill.zip -d .claude/skills/supabase-ci-integration && rm skill.zip

Installs to .claude/skills/supabase-ci-integration

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure Supabase continuous-integration and deployment pipelines with GitHub Actions: link projects, push migrations, deploy Edge Functions, generate types, and run tests against local Supabase instances. Use when setting up CI pipelines for Supabase, automating database migrations, deploying Edge Functions in CI, or running integration tests. Trigger with phrases like "supabase CI", "supabase GitHub Actions", "supabase deploy pipeline", "CI supabase migrations", "supabase preview branches".
498 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Link Supabase projects in CI environments
  • Push database migrations on code merges
  • Deploy Edge Functions automatically
  • Generate TypeScript types from Supabase schema
  • Run pgTAP and application tests against local Supabase instances

How it works

The skill sets up GitHub Actions workflows to start a local Supabase instance, apply migrations, regenerate TypeScript types, and run tests. It also configures deployment workflows to push migrations and deploy Edge Functions on merge.

Inputs & outputs

You give it
Supabase project configuration, GitHub Actions workflows, and code changes
You get back
Automated Supabase lifecycle in CI, validated database changes, and deployed Edge Functions

When to use supabase-ci-integration

  • Setting up automated database migrations
  • Running pgTAP tests in CI
  • Generating TypeScript types from schema
  • Deploying Edge Functions on merge
  • Creating preview branches for PRs

About this skill

Supabase CI Integration

Overview

Build GitHub Actions workflows that automate the full Supabase lifecycle: link projects in CI, push migrations on merge, deploy Edge Functions, generate TypeScript types, run tests against a local Supabase instance, and create preview branches for pull requests. Every database change gets validated before it reaches production.

The pull-request CI pipeline runs these stages, all detailed in ci-workflows.md:

  1. Start a local Supabase instance (unused services disabled for speed).
  2. Apply every migration from scratch with npx supabase db reset.
  3. Regenerate TypeScript types and fail the build on drift from the committed version.
  4. Run pgTAP database tests and the application test suite against the local instance.
  5. Stop Supabase (always, even on failure).

Prerequisites

  • GitHub repository with Actions enabled
  • Supabase project created at supabase.com/dashboard
  • Supabase CLI initialized locally (npx supabase init)
  • Node.js 18+ in your project
  • @supabase/supabase-js installed:
npm install @supabase/supabase-js

Instructions

Step 1: Configure GitHub Secrets and Link in CI

Store credentials as GitHub repository secrets. The CI pipeline uses these to authenticate with your Supabase project without exposing tokens in code.

# Set secrets via GitHub CLI
gh secret set SUPABASE_ACCESS_TOKEN --body "<your-access-token>"
gh secret set SUPABASE_DB_PASSWORD --body "<your-database-password>"
gh secret set SUPABASE_PROJECT_REF --body "<your-project-ref>"

Generate your access token at supabase.com/dashboard/account/tokens. Find your project ref in Project Settings > General.

Link the project in any CI job that needs remote access:

- name: Install Supabase CLI
  uses: supabase/setup-cli@v1
  with:
    version: latest

- name: Link Supabase project
  run: npx supabase link --project-ref ${{ secrets.SUPABASE_PROJECT_REF }}
  env:
    SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}

Step 2: CI Workflow — Test, Validate Migrations, and Generate Types

Add .github/workflows/supabase-ci.yml that runs on every pull request. It starts a local Supabase instance, runs db reset to apply all migrations from scratch, regenerates types and fails on drift (git diff --exit-code), then runs pgTAP and application tests. The default local dev keys are safe to commit — they only work against the local instance. Copy the complete workflow from ci-workflows.md.

Step 3: Deploy Migrations and Edge Functions on Merge

Add .github/workflows/supabase-deploy.yml, scoped with paths: to supabase/migrations/** and supabase/functions/** so it only runs when database or function code changes on main. It links the remote project, runs npx supabase db push, deploys Edge Functions, and regenerates types from the production schema. Full workflow in ci-workflows.md.

Preview Branches

Create isolated Supabase environments per pull request with npx supabase branches create, so reviewers test against real infrastructure with migrations applied. Preview branches require a Supabase Pro plan and incur compute costs while running. Workflow snippet in ci-workflows.md.

Testing in CI

Two test layers run inside the CI workflow:

  • pgTAP database tests in supabase/tests/ validate that RLS is enabled on public tables and that policies behave correctly. Run locally with npx supabase test db.
  • Application tests use createClient from @supabase/supabase-js pointed at http://127.0.0.1:54321 with the local anon key.

Both patterns — the pgTAP SQL and the TypeScript client setup — are in testing-patterns.md.

Output

After implementing these workflows:

  • Pull requests run tests against a fresh local Supabase instance with all migrations applied
  • TypeScript type drift is detected automatically — stale types block the PR
  • Database migrations deploy to production only on merge to main
  • Edge Functions deploy alongside migration changes
  • pgTAP tests validate RLS policies and schema constraints in CI
  • Preview branches provide isolated environments for PR review (Pro plan)
  • GitHub secrets keep SUPABASE_ACCESS_TOKEN and SUPABASE_DB_PASSWORD out of code

Error Handling

ErrorCauseSolution
supabase start fails in CIDocker not availableUse ubuntu-latest runner (includes Docker by default)
supabase db push returns "permission denied"Invalid or expired access tokenRegenerate token at supabase.com/dashboard/account/tokens
supabase link failsWrong project refCheck project ref in Settings > General, must match SUPABASE_PROJECT_REF secret
Type drift detected in PRSchema changed without regenerating typesRun npx supabase gen types typescript --local > src/types/database.types.ts
supabase functions deploy failsMissing Deno types or syntax errorsRun npx supabase functions serve locally first to catch issues
pgTAP tests failMissing RLS policies or schema constraintsAdd policies before merging — npx supabase test db runs locally
Preview branch creation failsFree plan limitationPreview branches require Supabase Pro plan
Migration conflict on pushDivergent migration historyRun npx supabase db pull to reconcile remote vs local migrations

Examples

Minimal CI for a new project — just migration validation and type checking:

name: Supabase CI
on: [pull_request]
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: supabase/setup-cli@v1
        with: { version: latest }
      - run: npx supabase start -x realtime,storage-api,imgproxy,inbucket,edge-runtime
      - run: npx supabase db reset
      - run: npx supabase gen types typescript --local > /tmp/types.ts && diff src/types/database.types.ts /tmp/types.ts
      - if: always()
        run: npx supabase stop

For the full CI + deploy + preview workflows and an Edge Function deploy-with-verification snippet, see ci-workflows.md.

Resources

Next Steps

For deploying Supabase-backed applications to hosting platforms, see supabase-deploy-integration. For configuring RLS policies, see supabase-rls-policies.

Prerequisites

GitHub repository with Actions enabledSupabase project createdSupabase CLI initialized locallyNode.js 18+ in your project

Limitations

  • Preview branches require a Supabase Pro plan
  • Docker must be available for `supabase start` in CI

How it compares

This skill automates the entire Supabase CI/CD pipeline, including local testing and type generation, unlike manual processes that require separate steps for each action.

Compared to similar skills

supabase-ci-integration side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
supabase-ci-integration (this skill)327dReviewIntermediate
supabase-policy-guardrails327dReviewAdvanced
aws-aurora14moReviewIntermediate
supabase14moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry