From 56292dcb2232b1d6d33e2a9ee2bee6fca211f087 Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:09:49 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20CD=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cf6ba9d..0a04d22b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Create Directory on Remote Server on: push: branches: - - main + - feature-be-#110 jobs: create-directory: @@ -48,7 +48,7 @@ jobs: - name: Copy deploy.sh to remote server uses: appleboy/scp-action@v0.1.1 with: - host: ${{ secrets.REMOTE_IP }} + host: ${{ secrets.REMOTE_DEV_IP }} username: ${{ secrets.REMOTE_USER }} key: ${{ secrets.REMOTE_PRIVATE_KEY }} source: ./deploy.sh From ba69026918beae0603550652666a0fb4ba0d86dc Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:19:05 +0900 Subject: [PATCH 2/8] =?UTF-8?q?refactor:=20=ED=94=84=EB=A1=A0=ED=8A=B8,=20?= =?UTF-8?q?=EB=B0=B1=EC=97=94=EB=93=9C=20CD=20=EB=B3=91=EB=A0=AC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a04d22b..fbd0f588 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: - feature-be-#110 jobs: - create-directory: + frontend-CD: runs-on: ubuntu-latest steps: @@ -37,19 +37,15 @@ jobs: aws configure set region ap-northeast-2 aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp ./frontend/dist s3://octodocs/ --recursive --debug - # 패키지 설치 및 Nest.js 빌드 - - name: Install dependencies and build - run: | - cd backend - npm install - npm run build - # 배포용 쉘 스크립트 파일 전송 - - name: Copy deploy.sh to remote server - uses: appleboy/scp-action@v0.1.1 - with: - host: ${{ secrets.REMOTE_DEV_IP }} - username: ${{ secrets.REMOTE_USER }} - key: ${{ secrets.REMOTE_PRIVATE_KEY }} - source: ./deploy.sh - target: /home/root/deploy.sh + backend-CD: + + # 배포용 쉘 스크립트 파일 전송 + - name: Copy deploy.sh to remote server + uses: appleboy/scp-action@v0.1.1 + with: + host: ${{ secrets.REMOTE_DEV_IP }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.REMOTE_PRIVATE_KEY }} + source: ./deploy.sh + target: /home/root/deploy.sh \ No newline at end of file From 6bc4403eec12f473d39d68eca97e32170618cac5 Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:21:07 +0900 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=20yml=20=EB=AC=B8=EB=B2=95=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbd0f588..838358fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,16 +36,19 @@ jobs: aws configure set aws_secret_access_key $NCLOUD_SECRET_ACCESS_KEY aws configure set region ap-northeast-2 aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp ./frontend/dist s3://octodocs/ --recursive --debug - - backend-CD: + runs-on: ubuntu-latest - # 배포용 쉘 스크립트 파일 전송 - - name: Copy deploy.sh to remote server - uses: appleboy/scp-action@v0.1.1 - with: - host: ${{ secrets.REMOTE_DEV_IP }} - username: ${{ secrets.REMOTE_USER }} - key: ${{ secrets.REMOTE_PRIVATE_KEY }} - source: ./deploy.sh - target: /home/root/deploy.sh \ No newline at end of file + steps: + # 코드 체크아웃 + - name: Checkout code + uses: actions/checkout@v3 + # 배포용 쉘 스크립트 파일 전송 + - name: Copy deploy.sh to remote server + uses: appleboy/scp-action@v0.1.1 + with: + host: ${{ secrets.REMOTE_DEV_IP }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.REMOTE_PRIVATE_KEY }} + source: ./deploy.sh + target: /home/root/deploy.sh From eff74a09d419aacdb9cb41b078ae13d1c4b23653 Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:40:39 +0900 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20scp-action=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 838358fb..564d6026 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v3 # 배포용 쉘 스크립트 파일 전송 - name: Copy deploy.sh to remote server - uses: appleboy/scp-action@v0.1.1 + uses: appleboy/scp-action@master with: host: ${{ secrets.REMOTE_DEV_IP }} username: ${{ secrets.REMOTE_USER }} From 21c1eba914f7ea1bd4086d85c9328bcccc2382dc Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:58:21 +0900 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20env=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=B0=8F=20sh=20=EC=8B=A4=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 17 ++++++++++++++++- deploy.sh | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 564d6026..71b69b74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,12 @@ jobs: # 코드 체크아웃 - name: Checkout code uses: actions/checkout@v3 + + # .env 파일 생성 후 붙여넣기 + - name: Create .env file + run: | + echo "${{secrets.DEVELOPMENT_ENV}}" > ./.env + # 배포용 쉘 스크립트 파일 전송 - name: Copy deploy.sh to remote server uses: appleboy/scp-action@master @@ -51,4 +57,13 @@ jobs: username: ${{ secrets.REMOTE_USER }} key: ${{ secrets.REMOTE_PRIVATE_KEY }} source: ./deploy.sh - target: /home/root/deploy.sh + target: /home/root + # 쉘 스크립트 실행 + - name: Run command on remote server + uses: appleboy/ssh-action@v0.1.3 + with: + host: ${{ secrets.REMOTE_DEV_IP }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.PRIVATE_KEY }} + script: | + sh /home/root/deploy.sh diff --git a/deploy.sh b/deploy.sh index a324ae67..8042e1cc 100644 --- a/deploy.sh +++ b/deploy.sh @@ -31,7 +31,7 @@ fi # 의존성 설치 및 애플리케이션 시작 echo "의존성 설치 중..." -npm install +yarn install echo "애플리케이션 시작 중..." -nohup npm start & +nohup yarn start & From 3a9ae8692bd42f41e6c4c92cc997c3cff39c6d7b Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:01:23 +0900 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20ssh-action=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 71b69b74..c2c905f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,10 +60,10 @@ jobs: target: /home/root # 쉘 스크립트 실행 - name: Run command on remote server - uses: appleboy/ssh-action@v0.1.3 + uses: appleboy/ssh-action@master with: host: ${{ secrets.REMOTE_DEV_IP }} username: ${{ secrets.REMOTE_USER }} - key: ${{ secrets.PRIVATE_KEY }} + key: ${{ secrets.REMOTE_PRIVATE_KEY }} script: | sh /home/root/deploy.sh From 9e0b45ee4fecb0e491856a3ecf4318497dd9f725 Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:43:11 +0900 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20.env=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=B3=B4=EB=82=B4=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2c905f1..aa74755d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,15 @@ jobs: - name: Create .env file run: | echo "${{secrets.DEVELOPMENT_ENV}}" > ./.env + # .env 파일 전송 + - name: Copy deploy.sh to remote server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.REMOTE_DEV_IP }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.REMOTE_PRIVATE_KEY }} + source: ./.env + target: /home/root/app/autodocs # 배포용 쉘 스크립트 파일 전송 - name: Copy deploy.sh to remote server From dbf3a8bcc897335eda90c1cfb1f2e30f7dea98ff Mon Sep 17 00:00:00 2001 From: ez <105545215+ezcolin2@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:48:10 +0900 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20base=20branch=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa74755d..0c331bde 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Create Directory on Remote Server on: push: branches: - - feature-be-#110 + - develop jobs: frontend-CD: