Skip to content

Commit

Permalink
feat : Github Secrets의 값을 끼워 넣어주는 step 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yel-m committed May 3, 2024
1 parent 042fd4c commit bbff677
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: HappinesSQL CI/CD
# 2. 워크플로가 시작될 조건 지정
on:
pull_request:
types: [closed]
types: [ closed ]
workflow_dispatch:

jobs:
Expand All @@ -27,6 +27,17 @@ jobs:
run: chmod +x ./gradlew
shell: bash # 권한 부여

- name: Set Environment
uses: microsoft/variable-substitution@v1
with:
files: ./src/main/resources/application.yml
env:
cloud.aws.credentials.access-key: ${{ secrets.AWS_S3_ACCESS_KEY }}
cloud.aws.credentials.secret-key: ${{ secrets.AWS_S3_SECRET_KEY }}
spring.datasource.url: ${{ secrets.DB_URL }}
spring.datasource.username: ${{ secrets.DB_USER }}
spring.datasource.password: ${{ secrets.DB_PASSWORD }}

- name: Build with Gradle
run: ./gradlew clean build -x test
shell: bash # build 시작
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spring:
# JPA
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ${DB_HOST}
url: ${DB_HOST} # TODO: 나중에 환경변수 DB_URL로 변경
username: ${DB_USER}
password: ${DB_PASSWORD}
jpa:
Expand Down

0 comments on commit bbff677

Please sign in to comment.