From 9bbd8e0790ca0ded029ff565c9ca3cb73791fae1 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 24 Oct 2024 20:02:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Use=20vercel=20config=20for=20ap?= =?UTF-8?q?p=20(#1412)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + apps/landing/vercel.json | 2 +- apps/web/vercel.json | 5 +++++ package.json | 2 ++ packages/database/prisma/schema.prisma | 1 + scripts/vercel.sh | 6 ------ 6 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 apps/web/vercel.json delete mode 100755 scripts/vercel.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2cf89296..481d3ddc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,7 @@ jobs: runs-on: ubuntu-latest env: DATABASE_URL: postgresql://postgres:postgres@localhost:5450/rallly + DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5450/rallly CI: true steps: - uses: actions/checkout@v4 diff --git a/apps/landing/vercel.json b/apps/landing/vercel.json index 585f9e3fa..4fbb00590 100644 --- a/apps/landing/vercel.json +++ b/apps/landing/vercel.json @@ -1,5 +1,5 @@ { "installCommand": "yarn install", - "buildCommand": "cd ../.. && yarn prisma generate && yarn turbo build --filter=@rallly/landing...", + "buildCommand": "cd ../.. && yarn db:generate && yarn build:landing && yarn db:deploy", "outputDirectory": ".next" } diff --git a/apps/web/vercel.json b/apps/web/vercel.json new file mode 100644 index 000000000..d1eb56f2f --- /dev/null +++ b/apps/web/vercel.json @@ -0,0 +1,5 @@ +{ + "installCommand": "yarn install", + "buildCommand": "cd ../.. && yarn db:generate && yarn build:web && yarn db:deploy", + "outputDirectory": ".next" +} diff --git a/package.json b/package.json index 1499dd054..e3d27dda5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "dev:landing": "dotenv -c development turbo dev --filter=@rallly/landing", "start": "turbo run start --filter=@rallly/web", "build": "dotenv -c -- turbo run build --filter=@rallly/web", + "build:web": "turbo run build --filter=@rallly/web", + "build:landing": "turbo run build --filter=@rallly/landing", "build:test": "turbo build:test", "docs:dev": "turbo dev --filter=@rallly/docs...", "db:deploy": "prisma migrate deploy", diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index dfe7c3101..3a6aba9d7 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -1,6 +1,7 @@ datasource db { provider = "postgresql" url = env("DATABASE_URL") + directUrl = env("DIRECT_DATABASE_URL") relationMode = "prisma" } diff --git a/scripts/vercel.sh b/scripts/vercel.sh deleted file mode 100755 index 318cc0f9f..000000000 --- a/scripts/vercel.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -e -yarn prisma generate -yarn build -# Deploy migration using direct database connection (no connection pool) -DATABASE_URL=$DIRECT_DATABASE_URL yarn db:deploy