From 51f7360f51f522f0b9f75857a491b24c180e3800 Mon Sep 17 00:00:00 2001 From: EunbeenDev Date: Wed, 8 Jan 2025 19:12:39 +0900 Subject: [PATCH] =?UTF-8?q?[CICD]=20=EA=B8=B0=EC=A1=B4=20=ED=8F=AC?= =?UTF-8?q?=ED=8A=B8=20=ED=99=95=EC=9D=B8=20=EB=B0=8F=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=20=ED=9B=84=20=EC=9E=AC=EC=8B=9C=EB=8F=84=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 36d60ab..bd33cb9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -108,7 +108,6 @@ jobs: ssh -o StrictHostKeyChecking=no -T -i ~/.ssh/id_rsa ubuntu@${{ secrets.EC2_PUBLIC_IP }} << 'EOF' aws ecr get-login-password --region ${{ env.AWS_REGION }} | sudo docker login --username AWS --password-stdin $(aws ecr describe-repositories --repository-names ${{ env.ECR_REPOSITORY }} --query "repositories[0].repositoryUri" --output text) - # 기존 프로세스 확인 및 종료 if sudo lsof -i:8080; then echo "Port 8080 is in use. Stopping process..." sudo kill -9 $(sudo lsof -t -i:8080) || true @@ -116,14 +115,11 @@ jobs: echo "Port 8080 is free." fi - # Docker 이미지 Pull sudo docker pull $(aws ecr describe-repositories --repository-names ${{ env.ECR_REPOSITORY }} --query "repositories[0].repositoryUri" --output text):${{ github.sha }} - # 기존 컨테이너 중지 및 제거 sudo docker stop ${{ env.DOCKER_IMAGE_NAME }} || true sudo docker rm ${{ env.DOCKER_IMAGE_NAME }} || true - # 새 컨테이너 실행 sudo docker run -d -p 8080:8080 --name ${{ env.DOCKER_IMAGE_NAME }} $(aws ecr describe-repositories --repository-names ${{ env.ECR_REPOSITORY }} --query "repositories[0].repositoryUri" --output text):${{ github.sha }} EOF