Skip to content

Commit

Permalink
chore: backend cd yml 오류 수정
Browse files Browse the repository at this point in the history
Co-authored-by: coli-geonwoo <[email protected]>
  • Loading branch information
eun-byeol and coli-geonwoo committed Jul 20, 2024
1 parent 7368765 commit 620f4be
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/backend-cicd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
DOCKERHUB_REPOSITORY: ody-official
DOCKER_CONTAINER_NAME: ody-backend

jobs:
build-docker-push:
Expand Down Expand Up @@ -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 }}

0 comments on commit 620f4be

Please sign in to comment.