diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index d4fd1cb..aea08a8 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -38,24 +38,13 @@ jobs: docker build -t api-image -f Backend/dockerfile . - #Check if API Container is running - - name: is container running? - run: | - if [ "$(docker ps -q -f name=api-container)" ]; then - echo "Stopping existing API container..." - docker stop api-container - sleep 10 - fi - if [ "$(docker ps -aq -f status=exited -f name=api-container)" ]; then - echo "Removing existing API container..." - docker rm api-container - fi - # Stop and Remove Existing Container (if any). this was the error - name: Stop and Remove Existing API Container run: | docker stop api-container || true # Stop if running, ignore if not + sleep 10 docker rm api-container || true # Remove if exists, ignore if not + sleep 10 #Start API Container - name: Start API Container