From 2811540d9a9e3dd66cef3450dc399e667c43deda Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Thu, 4 Sep 2025 11:45:24 -0400 Subject: [PATCH] less edgy config (ci) --- .github/workflows/test_next_server.yml | 6 +++++- www/app/lib/edgeConfig.ts | 4 ++-- www/app/lib/next.ts | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_next_server.yml b/.github/workflows/test_next_server.yml index d6671bf6..98d2a71f 100644 --- a/.github/workflows/test_next_server.yml +++ b/.github/workflows/test_next_server.yml @@ -43,6 +43,10 @@ jobs: - name: Run tests run: pnpm test + env: + IS_CI: "true" - name: Build - run: pnpm build \ No newline at end of file + run: pnpm build + env: + IS_CI: "true" \ No newline at end of file diff --git a/www/app/lib/edgeConfig.ts b/www/app/lib/edgeConfig.ts index c680d781..15ec9689 100644 --- a/www/app/lib/edgeConfig.ts +++ b/www/app/lib/edgeConfig.ts @@ -1,6 +1,6 @@ import { get } from "@vercel/edge-config"; -import { isBuildPhase } from "./next"; +import { isBuildPhase, isCI } from "./next"; type EdgeConfig = { [domainWithDash: string]: { @@ -32,7 +32,7 @@ export function edgeDomainToKey(domain: string) { export async function getConfig() { const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname; - if (isBuildPhase) { + if (isCI) { // "noop" return require("../../config-template").localConfig; } diff --git a/www/app/lib/next.ts b/www/app/lib/next.ts index 91d88bd2..3409642c 100644 --- a/www/app/lib/next.ts +++ b/www/app/lib/next.ts @@ -1,2 +1,3 @@ // next.js tries to run all the lib code during build phase; we don't always want it when e.g. we have connections initialized we don't want to have export const isBuildPhase = process.env.NEXT_PHASE?.includes("build"); +export const isCI = process.env.IS_CI === "true";