Skip to content

Commit

Permalink
πŸ”¨ settings: ν™˜κ²½λ³€μˆ˜ μ—…λ°μ΄νŠΈ
Browse files Browse the repository at this point in the history
  • Loading branch information
froggy1014 committed Aug 17, 2024
1 parent 113e2ed commit 6a419f6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_STAGE=<STAGE>
NEXT_PUBLIC_BASE_URL=<BASE_URL>
6 changes: 6 additions & 0 deletions .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
NODE_VERSION:
required: true
type: string
NEXT_PUBLIC_STAGE:
required: true
type: string


jobs:
build:
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
uses: ./.github/workflows/_build.yaml
with:
NODE_VERSION: 20.x
NEXT_PUBLIC_STAGE: development
4 changes: 4 additions & 0 deletions src/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},

Expand Down

0 comments on commit 6a419f6

Please sign in to comment.