Skip to content

Commit

Permalink
Deploy: nignx를 제외한 나머지 모든 컨테이너를 정지하도록 cd.yml 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
KimChanJin97 committed Sep 30, 2024
1 parent 49d0624 commit ff9cf80
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ jobs:
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
CONTAINER_ID=$(sudo docker ps -q --filter "name=app")
if [ ! -z "$CONTAINER_ID" ]; then
sudo docker stop $CONTAINER_ID
sudo docker rm $CONTAINER_ID
fi
sudo docker ps -q | grep -v "$(sudo docker ps -q --filter "name=ubuntu-nginx-1")" | xargs -r sudo docker stop
echo "${{ secrets.DOCKER_COMPOSE_PROD_YML }}" > docker-compose-prod.yml
sudo docker-compose -f docker-compose-prod.yml pull
sudo docker-compose -f docker-compose-prod.yml up -d
Expand Down

0 comments on commit ff9cf80

Please sign in to comment.