From 46783dbcd424c8032dd2325719130098520ab29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B8=B0=EC=84=9C?= <81108344+rlarltj@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:58:22 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20prod=20=EC=84=9C=EB=B2=84=EB=A5=BC=20aw?= =?UTF-8?q?s=EB=A1=9C=20=EC=9D=B4=EA=B4=80=ED=95=9C=EB=8B=A4.=20=20(#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: prod 서버를 aws로 이관한다. * chore: remove deploy trigger --- .docker/docker-compose.yml | 1 + .github/workflows/deploy-prod.yml | 18 +++++++++--------- src/main/resources/application-prod.yml | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 739cbdd..31884d6 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -11,6 +11,7 @@ services: NCP_SECRET_KEY: ${NCP_SECRET_KEY} ACTIVE_PROFILE: ${ACTIVE_PROFILE} DB_ROOT_PASSWORD_DEV: ${DB_ROOT_PASSWORD_DEV} + DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} REDIS_HOST: ${REDIS_HOST} REDIS_PORT: ${REDIS_PORT} APPLE_PRIVATE_KEY: ${APPLE_PRIVATE_KEY} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 64946e8..1dc839b 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -30,9 +30,9 @@ 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_PROD_PASSWORD }} source: "./.env" target: "/home/ubuntu" @@ -51,9 +51,9 @@ 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_PROD_PASSWORD }} port: 22 source: "./.docker/docker-compose.yml" target: "/home/ubuntu/" @@ -62,9 +62,9 @@ jobs: - 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_PROD_PASSWORD }} script: | sudo cp /home/ubuntu/.docker/docker-compose.yml /home/ubuntu cd /home/ubuntu diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index ab73cdf..4f65042 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -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