-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Supabase CI/CD #1891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Supabase CI/CD #1891
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f3ea921
Add GitHub Actions workflows for Supabase staging and production envi…
devin-ai-integration[bot] aff144d
Update environment variable names to be more specific
devin-ai-integration[bot] 01aae91
update readme
Kitenite 20ba6ae
Merge branch 'main' into devin/1747607854-add-supabase-env-workflows
Kitenite 507a7d1
add migration files
Kitenite 87d75c4
add branch
Kitenite 638373d
update command
Kitenite 6de6f0b
remove schema validation
Kitenite 018115b
update migration path
Kitenite 782eeb1
update schema
Kitenite ced4fb7
pin bun version
Kitenite 5e20fa3
pin bun version
Kitenite adbd45f
add migration files
Kitenite cb9df7e
disable main
Kitenite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Deploy Drizzle Migrations to Supabase Staging | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - ci/supabase | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SUPABASE_DATABASE_URL: ${{ secrets.STAGING_SUPABASE_DATABASE_URL }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - run: bun install | ||
|
|
||
| - run: bun run db:push | ||
75 changes: 75 additions & 0 deletions
75
apps/backend/supabase/migrations/0000_same_human_robot.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| CREATE TYPE "public"."frame_type" AS ENUM('web');--> statement-breakpoint | ||
| CREATE TYPE "public"."role" AS ENUM('user', 'assistant', 'system');--> statement-breakpoint | ||
| CREATE TABLE "canvas" ( | ||
| "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
| "project_id" uuid NOT NULL, | ||
| "scale" numeric NOT NULL, | ||
| "x" numeric NOT NULL, | ||
| "y" numeric NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "canvas" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint | ||
| CREATE TABLE "frames" ( | ||
| "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
| "canvas_id" uuid NOT NULL, | ||
| "type" "frame_type" NOT NULL, | ||
| "url" varchar NOT NULL, | ||
| "x" numeric NOT NULL, | ||
| "y" numeric NOT NULL, | ||
| "width" numeric NOT NULL, | ||
| "height" numeric NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "frames" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint | ||
| CREATE TABLE "conversations" ( | ||
| "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
| "project_id" uuid NOT NULL, | ||
| "display_name" varchar, | ||
| "created_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
| "updated_at" timestamp with time zone DEFAULT now() NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "messages" ( | ||
| "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
| "conversation_id" uuid NOT NULL, | ||
| "content" text NOT NULL, | ||
| "created_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
| "role" "role" NOT NULL, | ||
| "applied" boolean DEFAULT false NOT NULL, | ||
| "snapshots" jsonb DEFAULT '{}'::jsonb NOT NULL, | ||
| "context" jsonb DEFAULT '[]'::jsonb NOT NULL, | ||
| "parts" jsonb DEFAULT '[]'::jsonb NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "projects" ( | ||
| "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
| "name" varchar NOT NULL, | ||
| "sandbox_id" varchar NOT NULL, | ||
| "sandbox_url" varchar NOT NULL, | ||
| "created_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
| "updated_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
| "preview_img" varchar, | ||
| "description" text | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "projects" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint | ||
| CREATE TABLE "users" ( | ||
| "id" uuid PRIMARY KEY NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "users" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint | ||
| CREATE TABLE "user_projects" ( | ||
| "user_id" uuid NOT NULL, | ||
| "project_id" uuid NOT NULL, | ||
| "created_at" timestamp with time zone DEFAULT now(), | ||
| CONSTRAINT "user_projects_user_id_project_id_pk" PRIMARY KEY("user_id","project_id") | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "user_projects" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint | ||
| ALTER TABLE "canvas" ADD CONSTRAINT "canvas_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "frames" ADD CONSTRAINT "frames_canvas_id_canvas_id_fk" FOREIGN KEY ("canvas_id") REFERENCES "public"."canvas"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "conversations" ADD CONSTRAINT "conversations_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "messages" ADD CONSTRAINT "messages_conversation_id_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."conversations"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "users" ADD CONSTRAINT "users_id_users_id_fk" FOREIGN KEY ("id") REFERENCES "auth"."users"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "user_projects" ADD CONSTRAINT "user_projects_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint | ||
| ALTER TABLE "user_projects" ADD CONSTRAINT "user_projects_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE cascade; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the Bun version rather than using 'latest' to ensure stable builds.