diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 671698127b..81345d82a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,6 +128,13 @@ jobs: - name: Build Next.js frontend run: yarn workspace main build + env: + NODE_ENV: production + NEXT_PUBLIC_ORIGIN: https://ci.learn.mit.edu + NEXT_PUBLIC_MITOL_API_BASE_URL: https://api.ci.learn.mit.edu + NEXT_PUBLIC_CSRF_COOKIE_NAME: cookie-monster + NEXT_PUBLIC_SITE_NAME: MIT Learn + NEXT_PUBLIC_MITOL_SUPPORT_EMAIL: help@ci.learn.mit.edu # do this before typecheck. See https://github.com/vercel/next.js/issues/53959#issuecomment-1735563224 - name: Typecheck diff --git a/frontends/main/next.config.js b/frontends/main/next.config.js index f97530c0d8..6283b8c7ab 100644 --- a/frontends/main/next.config.js +++ b/frontends/main/next.config.js @@ -1,4 +1,7 @@ // @ts-check +const { validateEnv } = require("./validateEnv") + +validateEnv() /** @type {import('next').NextConfig} */ const nextConfig = { diff --git a/frontends/main/src/app/layout.tsx b/frontends/main/src/app/layout.tsx index cf32f524c3..2f3f280abe 100644 --- a/frontends/main/src/app/layout.tsx +++ b/frontends/main/src/app/layout.tsx @@ -6,6 +6,7 @@ import Footer from "@/page-components/Footer/Footer" import { PageWrapper, PageWrapperInner } from "./styled" import Providers from "./providers" import { MITLearnGlobalStyles } from "ol-components" +import Script from "next/script" import "./GlobalStyles" @@ -26,6 +27,9 @@ export default function RootLayout({ + {process.env.NEXT_PUBLIC_APPZI_URL ? ( +