Skip to content

Commit e62c5f0

Browse files
committed
Github Action에서 Secret을 이용한 키파일 생성
1 parent f540da6 commit e62c5f0

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ jobs:
1818
distribution: 'zulu'
1919
java-version: '17'
2020

21+
# Github Repository Secrets를 통해 application-key.yml 파일 생성
22+
- name: Generate Key File
23+
run: |
24+
echo "GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" >> application-key.yml
25+
echo "GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET" >> application-key.yml
26+
echo "ISSUER=$ISSUER" >> application-key.yml
27+
echo "SECRET_KEY=$SECRET_KEY" >> application-key.yml
28+
2129
- name: Grant execute permission for gradlew
2230
run: chmod +x gradlew
2331

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,6 @@ gradle-app.setting
217217

218218
### key file
219219
.env
220+
application-key.yml
220221

221222
# End of https://www.toptal.com/developers/gitignore/api/macos,intellij,java,gradle,git

src/main/resources/application.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
spring:
2+
config:
3+
import: application-key.yml
4+
25
security:
36
oauth2:
47
client:
58
registration:
69
google:
7-
client-id: ${google-client-id}
8-
client-secret: ${google-client-secret}
10+
client-id: ${GOOGLE_CLIENT_ID}
11+
client-secret: ${GOOGLE_CLIENT_SECRET}
912

1013
jpa:
1114
# Check for transfer query
@@ -25,5 +28,5 @@ spring:
2528
enabled: true
2629

2730
jwt:
28-
issuer: ${issuer}
29-
secret_key: ${secret_key}
31+
issuer: ${ISSUER}
32+
secret_key: ${SECRET_KEY}

0 commit comments

Comments
 (0)