Skip to content

Commit

Permalink
백엔드 프로덕션 배포 및 환경변수 등록 자동화 (#584)
Browse files Browse the repository at this point in the history
* feat: application-prod.yml에 jwt 설정값 추가

* 실행 테스트를 위해 apple redirect-uri 설정값 임시 추가

* refactor: 변경된 서버 환경에 대한 배포 자동화 및 환경변수 등록 스크립트 작성

* refactor: gitignore에서 application-prod.yml 제거

* refactor: 두 번째 프로덕션 서버에 배포할 때의 조건 추가

* fix: 배포 workflow 오타 수정

* refactor: 개발 서버 runner label 수정
  • Loading branch information
pricelees authored Oct 1, 2024
1 parent 09c6e65 commit 34a15eb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
deploy:
runs-on: [self-hosted, dev]
runs-on: [self-hosted, develop]

steps:
- name: deploy
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,35 @@ on:
- develop

jobs:
deploy:
runs-on: prod
deploy-on-prod1:
runs-on: [self-hosted, runner-prod1]

steps:
- name: update properties if exists
run: |
if [ -n "${{ secrets.NEW_PROPERTIES }}" ]; then
cd ~/deploy
echo "${{ secrets.NEW_PROPERTIES }}" > new_properties
./update-properties.sh
fi
- name: deploy
run: |
cd ~/deploy && ./deploy.sh
deploy-on-prod2:
runs-on: [self-hosted, runner-prod2]
needs: deploy-on-prod1

steps:
- name: update properties if exists
run: |
if [ -n "${{ secrets.NEW_PROPERTIES }}" ]; then
cd ~/deploy
echo "${{ secrets.NEW_PROPERTIES }}" > new_properties
./update-properties.sh
fi
- name: deploy
run: |
cd ~/deploy && ./deploy.sh
2 changes: 1 addition & 1 deletion .github/workflows/cicd-backend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
deploy:
needs: build
runs-on: [self-hosted, dev]
runs-on: [self-hosted, develop]

steps:
- name: change permission
Expand Down
1 change: 0 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ build/
out
logs
src/main/resources/firebase
src/main/resources/application-prod.yml
9 changes: 9 additions & 0 deletions backend/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@ spring:
password: ${SLAVE_MYSQL_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: ${SLAVE_MYSQL_URL}

jpa:
hibernate:
ddl-auto: none
show-sql: false

security:
jwt:
token:
secret-key: ${JWT_SECRET_KEY}
expire-length: ${JWT_EXPIRE_LENGTH}

url:
base: https://mouda.site

oauth:
kakao:
redirect-uri: https://mouda.site/kakao-o-auth
apple:
redirect-uri: https://mouda.site/apple-o-auth
1 change: 1 addition & 0 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ security:
token:
secret-key: kksangdolbabokksangdolbabokksangdolbabokksangdolbabokksangdolbabokksangdolbabo
expire-length: 3600000

url:
moim: /darakbang/%d/moim/%d
chat: /darakbang/%d/chat/%d
Expand Down

0 comments on commit 34a15eb

Please sign in to comment.