Skip to content

Commit

Permalink
🔨 fix(env) : 테스트 환경시 .env 사용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Jul 19, 2022
1 parent 96802e5 commit b9c6ec9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-in-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: create env file
run: |
touch .env
echo "${{ secrets.ENV_VARS }}" >> .env
# docker-compose를 활용해 테스트를 위한 컨테이너 환경을 구성합니다.
- name: Start containers
run: docker-compose -f "docker-compose.test.yml" up -d --build
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ services:
ports:
- '5432:5432'
env_file:
- .env.local
- .env
1 change: 0 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { SmsModule } from './sms/sms.module';
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: process.env.NODE_ENV === 'test' ? '.env.local' : '.env',
validationSchema: Joi.object({
NODE_ENV: Joi.string()
.valid('dev', 'prod', 'test', 'provision')
Expand Down

0 comments on commit b9c6ec9

Please sign in to comment.