diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index a7ad5e0..84ab3e5 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -37,6 +37,19 @@ jobs: run: | 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 + 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: |