From 6a419f64010b50f527088a8b147426fbb40f9361 Mon Sep 17 00:00:00 2001 From: Jeongmin Lee Date: Sun, 18 Aug 2024 05:06:10 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20settings:=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EB=B3=80=EC=88=98=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local.example | 2 ++ .github/workflows/_build.yaml | 6 ++++++ .github/workflows/pr_test.yaml | 1 + src/env/index.ts | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/.env.local.example b/.env.local.example index e69de29..4f5fb68 100644 --- a/.env.local.example +++ b/.env.local.example @@ -0,0 +1,2 @@ +NEXT_PUBLIC_STAGE= +NEXT_PUBLIC_BASE_URL= \ No newline at end of file diff --git a/.github/workflows/_build.yaml b/.github/workflows/_build.yaml index 7b786a4..48c6253 100644 --- a/.github/workflows/_build.yaml +++ b/.github/workflows/_build.yaml @@ -4,6 +4,10 @@ on: NODE_VERSION: required: true type: string + NEXT_PUBLIC_STAGE: + required: true + type: string + jobs: build: @@ -15,8 +19,10 @@ jobs: - name: Set up environment variables run: | echo "NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL" >> .env + echo "NEXT_PUBLIC_STAGE=$NEXT_PUBLIC_STAGE" >> .env env: NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }} + NEXT_PUBLIC_STAGE: ${{ inputs.NEXT_PUBLIC_STAGE }} - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/pr_test.yaml b/.github/workflows/pr_test.yaml index f2f5ba2..c13c716 100644 --- a/.github/workflows/pr_test.yaml +++ b/.github/workflows/pr_test.yaml @@ -10,3 +10,4 @@ jobs: uses: ./.github/workflows/_build.yaml with: NODE_VERSION: 20.x + NEXT_PUBLIC_STAGE: development diff --git a/src/env/index.ts b/src/env/index.ts index 78d1262..2fc1193 100644 --- a/src/env/index.ts +++ b/src/env/index.ts @@ -12,9 +12,13 @@ export const env = createEnv({ NEXT_PUBLIC_BASE_URL: z.string({ message: VALIDATION_ERROR_MESSAGES.required, }), + NEXT_PUBLIC_STAGE: z.string({ + message: VALIDATION_ERROR_MESSAGES.required, + }), }, runtimeEnv: { + NEXT_PUBLIC_STAGE: process.env.NEXT_PUBLIC_STAGE, NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL, },