Skip to content

Commit 620f4be

Browse files
eun-byeolcoli-geonwoo
andcommittedJul 20, 2024
chore: backend cd yml 오류 수정
Co-authored-by: coli-geonwoo <[email protected]>
1 parent 7368765 commit 620f4be

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎.github/workflows/backend-cicd-dev.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
env:
1414
DOCKERHUB_REPOSITORY: ody-official
15+
DOCKER_CONTAINER_NAME: ody-backend
1516

1617
jobs:
1718
build-docker-push:
@@ -68,11 +69,8 @@ jobs:
6869
- name: Pull Docker image from DockerHub
6970
run: docker pull --platform linux/x64/v8 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}
7071

71-
- name: Stop existing Docker container
72-
run: docker stop $DOCKERHUB_REPOSITORY || true
73-
74-
- name: Remove existing Docker container
75-
run: docker rm $DOCKERHUB_REPOSITORY || true
76-
7772
- name: Run new Docker container
78-
run: docker run -d --name ody-backend -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}
73+
run: |
74+
docker stop $DOCKER_CONTAINER_NAME || true
75+
docker rm $DOCKER_CONTAINER_NAME || true
76+
docker run -d --name $DOCKER_CONTAINER_NAME -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}

0 commit comments

Comments
 (0)