mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
less edgy config (ci)
This commit is contained in:
4
.github/workflows/test_next_server.yml
vendored
4
.github/workflows/test_next_server.yml
vendored
@@ -43,6 +43,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
env:
|
||||||
|
IS_CI: "true"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
env:
|
||||||
|
IS_CI: "true"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { get } from "@vercel/edge-config";
|
import { get } from "@vercel/edge-config";
|
||||||
|
|
||||||
import { isBuildPhase } from "./next";
|
import { isBuildPhase, isCI } from "./next";
|
||||||
|
|
||||||
type EdgeConfig = {
|
type EdgeConfig = {
|
||||||
[domainWithDash: string]: {
|
[domainWithDash: string]: {
|
||||||
@@ -32,7 +32,7 @@ export function edgeDomainToKey(domain: string) {
|
|||||||
export async function getConfig() {
|
export async function getConfig() {
|
||||||
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
||||||
|
|
||||||
if (isBuildPhase) {
|
if (isCI) {
|
||||||
// "noop"
|
// "noop"
|
||||||
return require("../../config-template").localConfig;
|
return require("../../config-template").localConfig;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
// 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 isBuildPhase = process.env.NEXT_PHASE?.includes("build");
|
||||||
|
export const isCI = process.env.IS_CI === "true";
|
||||||
|
|||||||
Reference in New Issue
Block a user