From 6182a79ae42a2a3150966d3ce1abfbe143af83aa Mon Sep 17 00:00:00 2001 From: htlee Date: Wed, 18 Mar 2026 08:38:49 +0900 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20SSH=20=ED=98=B8=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=82=B4=EB=B6=80=20IP=20=EA=B3=A0=EC=A0=95=20(sig?= =?UTF-8?q?nal-batch=20=ED=8C=A8=ED=84=B4)=20(#47)=20Co-authored-by:=20htl?= =?UTF-8?q?ee=20=20Co-committed-by:=20htlee=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4aacc0b..da1fc58 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -85,15 +85,14 @@ jobs: - name: Restart backend via SSH env: DEPLOY_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + DEPLOY_HOST: 192.168.1.20 run: | mkdir -p ~/.ssh echo "$DEPLOY_KEY" > ~/.ssh/id_deploy chmod 600 ~/.ssh/id_deploy - # Docker 컨테이너 → 호스트: default gateway (최소 의존) - DOCKER_HOST_IP=$(cat /proc/net/route | awk '$2 == "00000000" {printf "%d.%d.%d.%d", "0x"substr($3,7,2), "0x"substr($3,5,2), "0x"substr($3,3,2), "0x"substr($3,1,2); exit}') - ssh-keyscan $DOCKER_HOST_IP >> ~/.ssh/known_hosts 2>/dev/null || true + ssh-keyscan $DEPLOY_HOST >> ~/.ssh/known_hosts 2>/dev/null || true - SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no root@$DOCKER_HOST_IP" + SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no root@$DEPLOY_HOST" $SSH_CMD bash -s << 'RESTART' set -e