From 620f4be9eddc460b1dd9bea2ef204e9ee560d429 Mon Sep 17 00:00:00 2001 From: eun-byeol Date: Sat, 20 Jul 2024 10:28:09 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20backend=20cd=20yml=20=EC=98=A4?= =?UTF-8?q?=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 Co-authored-by: coli-geonwoo --- .github/workflows/backend-cicd-dev.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend-cicd-dev.yml b/.github/workflows/backend-cicd-dev.yml index 784847732..27dd6e129 100644 --- a/.github/workflows/backend-cicd-dev.yml +++ b/.github/workflows/backend-cicd-dev.yml @@ -12,6 +12,7 @@ on: env: DOCKERHUB_REPOSITORY: ody-official + DOCKER_CONTAINER_NAME: ody-backend jobs: build-docker-push: @@ -68,11 +69,8 @@ jobs: - name: Pull Docker image from DockerHub run: docker pull --platform linux/x64/v8 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }} - - name: Stop existing Docker container - run: docker stop $DOCKERHUB_REPOSITORY || true - - - name: Remove existing Docker container - run: docker rm $DOCKERHUB_REPOSITORY || true - - name: Run new Docker container - run: docker run -d --name ody-backend -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }} + run: | + docker stop $DOCKER_CONTAINER_NAME || true + docker rm $DOCKER_CONTAINER_NAME || true + docker run -d --name $DOCKER_CONTAINER_NAME -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}