Skip to content

Commit a0c2031

Browse files
committed
fix: 빌드시 테스트용 jwt 시크릿 키를 ssm에서 가져오도록 수정
1 parent 848a66b commit a0c2031

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,24 @@ jobs:
151151
architecture: 'x64'
152152
cache: 'gradle'
153153

154+
- name: Get TEST_JWT_SECRET_KEY from SSM
155+
id: get-test-secret
156+
run: |
157+
SECRET_VALUE=$(aws ssm get-parameter \
158+
--name "/common/TEST_JWT_SECRET_KEY" \
159+
--with-decryption \
160+
--region "${{ env.AWS_REGION }}" \
161+
--query "Parameter.Value" \
162+
--output text)
163+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
164+
154165
- name: Build with Gradle
155166
run: |
156167
cd ${{ github.workspace }}
157168
chmod +x gradlew
158169
./gradlew clean build -Dspring.profiles.active=dev
170+
env:
171+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
159172

160173
- name: Login to Amazon ECR
161174
id: login-ecr

.github/workflows/deploy-prod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,24 @@ jobs:
163163
architecture: 'x64'
164164
cache: 'gradle'
165165

166+
- name: Get TEST_JWT_SECRET_KEY from SSM
167+
id: get-test-secret
168+
run: |
169+
SECRET_VALUE=$(aws ssm get-parameter \
170+
--name "/common/TEST_JWT_SECRET_KEY" \
171+
--with-decryption \
172+
--region "${{ env.AWS_REGION }}" \
173+
--query "Parameter.Value" \
174+
--output text)
175+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
176+
166177
- name: Build with Gradle
167178
run: |
168179
cd ${{ github.workspace }}
169180
chmod +x gradlew
170181
./gradlew clean build -Dspring.profiles.active=prod
182+
env:
183+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
171184

172185
- name: Login to Amazon ECR
173186
id: login-ecr

0 commit comments

Comments
 (0)