Skip to content

Commit

Permalink
Merge pull request #34 from 8Bit-beep/fix/#33
Browse files Browse the repository at this point in the history
[Build] :: fix yml / dockerfile
  • Loading branch information
lgwk42 authored Jun 10, 2024
2 parents 674a1b7 + 07a32ae commit 7f7c0b2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
Binary file modified .DS_Store
Binary file not shown.
18 changes: 15 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI/CD using github actions & docker
on:
push:
branches: [ "main" ] # 해당 branch에 푸쉬 발생 시 업데이트
# pull_request:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
CI-CD:
runs-on: ubuntu-latest
Expand All @@ -17,6 +17,18 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: set yml file
uses: microsoft/variable-substitution@v1
with:
files: src/main/resources/application.yml
env:
spring.datasource.url: ${{ secrets.DB_URL }}
spring.datasource.username: ${{ secrets.DB_USERNAME }}
spring.datasource.password: ${{ secrets.DB_PASSWORD }}
spring.mail.username: ${{ secrets.MAIL_USERNAME }}
spring.mail.password: ${{ secrets.MAIL_PASSWORD }}
application.jwt.secretKey: ${{ secrets.JWT_SECRET_KEY }}

- name: set chmod
run: chmod +x ./gradlew

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ out/
### VS Code ###
.vscode/

src/main/resources/application-local.yml


2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:17
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENV TZ=Asia/Seoul
ENTRYPOINT ["java","-jar","/app.jar","-Duser.timezone=Asia/Seoul"]
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=prod","/app.jar","-Duser.timezone=Asia/Seoul"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "jwt")
@ConfigurationProperties(prefix = "application.jwt")
public class JwtProperties {
private String secretKey;
private String header;
Expand Down
26 changes: 15 additions & 11 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
spring:
profiles:
active: prod
datasource:
url: jdbc:mysql://beep-db-instance.c96ms6m44sen.ap-northeast-2.rds.amazonaws.com:3306/beepDatabase
url: ${secrets.DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: beep_user
password: qwer1234
username: ${secrets.DB_USERNAME}
password: ${secrets.DB_PASSWORD}

jpa:
hibernate:
ddl-auto: update
Expand All @@ -20,8 +23,8 @@ spring:
port: 6379

mail:
username: [email protected]
password: cyje eoaq uxsv upst
username: ${secrets.MAIL_USERNAME}
password: ${secrets.MAIL_PASSWORD}
host: smtp.gmail.com
port: 587
properties:
Expand All @@ -31,12 +34,13 @@ spring:
smtp.timeout: 50000 # SMTP ??? ??? ???? ??? ???? ?? ??? 50,000ms
smtp.starttls.enable: true

jwt:
refresh-exp: 2592000000 #30일
access-exp: 86400000 # 24시간
prefix: Bearer
header: Authorization
secret-key: 5ef05a8c246eb343d8d94e777b56eb386d403be81cfeabba90035e429a4e808c
application:
jwt:
refresh-exp: 2592000000 #30일
access-exp: 86400000 # 24시간
prefix: Bearer
header: Authorization
secretKey: ${secrets.JWT_SECRET_KEY}

springdoc:
api-docs:
Expand Down

0 comments on commit 7f7c0b2

Please sign in to comment.