Skip to content

Commit

Permalink
fix: got rid of || true in parts of the workflow to ensure that exist…
Browse files Browse the repository at this point in the history
…ing containers are stopped and removed
  • Loading branch information
Songmin17 committed Nov 22, 2023
1 parent 3928d70 commit 7de61e7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ jobs:
PEM_KEY: ${{ secrets.PEM }}
CLOUD_URL: ${{ secrets.CLOUD_URL }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
CONTAINER_NAME: haeng
run: |
echo "$PEM_KEY" > key.pem
chmod 600 key.pem
ssh -i key.pem -o StrictHostKeyChecking=no ec2-user@$CLOUD_URL << 'EOF'
docker stop $CONTAINER_NAME || true
docker rm $CONTAINER_NAME || true
docker rmi $DOCKER_USERNAME/haengsha-backend:latest || true
docker stop haeng
docker rm haeng
docker rmi $DOCKER_USERNAME/haengsha-backend:latest
tmux kill-server || true
docker pull $DOCKER_USERNAME/haengsha-backend:latest
docker run -d --name $CONTAINER_NAME -p 8080:8000 --env-file haengsha-env/.env $DOCKER_USERNAME/haengsha-backend:latest
Expand Down

0 comments on commit 7de61e7

Please sign in to comment.