Skip to content

Commit

Permalink
feat: prod 서버를 aws로 이관한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj committed Sep 23, 2024
1 parent 0a6fd2c commit 7b8ada8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- feat/**

# 권한 설정
permissions:
Expand All @@ -30,11 +31,11 @@ jobs:
- name: Send env file
uses: appleboy/scp-action@master
with:
username: root
host: ${{ secrets.NCP_PROD_IP }}
password: ${{ secrets.NCP_PROD_PASSWORD }}
username: ubuntu
host: ${{ secrets.AWS_PROD_IP }}
key: ${{ secrets.AWS_PASSWORD }}
source: "./.env"
target: "/home/ubuntu"
target: "/home"

# 빌드
- name: Build with Gradle
Expand All @@ -51,20 +52,20 @@ jobs:
- name: Send docker-compose.yml
uses: appleboy/scp-action@master
with:
username: root
host: ${{ secrets.NCP_PROD_IP }}
password: ${{ secrets.NCP_PROD_PASSWORD }}
username: ubuntu
host: ${{ secrets.AWS_PROD_IP }}
key: ${{ secrets.AWS_PASSWORD }}
port: 22
source: "./.docker/docker-compose.yml"
target: "/home/ubuntu/"
target: "/home"

# 도커 컴포즈 실행
- name: Deploy to Prod
uses: appleboy/ssh-action@master
with:
username: root
host: ${{ secrets.NCP_PROD_IP }}
password: ${{ secrets.NCP_PROD_PASSWORD }}
username: ubuntu
host: ${{ secrets.AWS_PROD_IP }}
key: ${{ secrets.AWS_PASSWORD }}
script: |
sudo cp /home/ubuntu/.docker/docker-compose.yml /home/ubuntu
cd /home/ubuntu
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spring:
datasource:
db:
pool-name: moneymong
jdbc-url: jdbc:mysql://101.101.216.85:3306/moneymong?useSSL=false&&allowPublicKeyRetrieval=true
jdbc-url: jdbc:mysql://rds-moneymong.ct8sumky2j68.ap-northeast-2.rds.amazonaws.com:3306/moneymong?useSSL=false&allowPublicKeyRetrieval=true
username: root
password: ${DB_ROOT_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down

0 comments on commit 7b8ada8

Please sign in to comment.