From 45394b96d075539ab26c2317deff0fa07d350acb Mon Sep 17 00:00:00 2001 From: JYKIM317 Date: Fri, 29 Nov 2024 23:24:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Github=20Actions=20Worflow=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 배포 workflow의 env 변수 사용이 잘못되었던 부분을 수정하였습니다. --- .github/workflows/deployment.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7bf7705f..5e58b0f2 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -15,13 +15,14 @@ jobs: SERVER_HOST: ${{ secrets.FUNCH_HOST }} SERVER_USER: ${{ secrets.FUNCH_USER }} run: | - echo "${FUNCH_SSH_KEY}" > deploy_key + echo "${SSH_PRIVATE_KEY}" > deploy_key chmod 600 deploy_key - ssh -i deploy_key ${{ secrets.FUNCH_USER }}@${{ secrets.FUNCH_HOST}} - cd /root/web25-funch - git switch main - git pull origin main - pm2 reload ecosystem.config.js + ssh -i deploy_key "${SERVER_USER}"@"${SERVER_HOST}" << EOF + cd /root/web25-funch + git switch main + git pull origin main + pm2 reload ecosystem.config.js + EOF media-deploy: runs-on: ubuntu-latest @@ -32,11 +33,12 @@ jobs: SERVER_HOST: ${{ secrets.MEDIA_HOST }} SERVER_USER: ${{ secrets.MEDIA_USER }} run: | - echo "${MEDIA_SSH_KEY}" > deploy_key + echo "${SSH_PRIVATE_KEY}" > deploy_key chmod 600 deploy_key - ssh -i deploy_key ${{ secrets.MEDIA_USER }}@${{ secrets.MEDIA_HOST}} - git switch main - cd /service/web25-funch - git pull origin main - cd mediaServer - pm2 reload ecosystem.config.js + ssh -i deploy_key "${SERVER_USER}"@"${SERVER_HOST}" << EOF + cd /service/web25-funch + git switch main + git pull origin main + cd mediaServer + pm2 reload ecosystem.config.js + EOF