diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a7da4ad..346e8a5 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -167,7 +167,14 @@ jobs: export ALLOWED_HOSTS='${{ secrets.ALLOWED_HOSTS }}' export DOMAIN_NAME='${{ secrets.DOMAIN_NAME }}' - pkill -f "uvicorn main:app" + uvicorn_pid=$(pgrep -f "uvicorn main:app") + + if [ -n "$uvicorn_pid" ]; then + echo "Stopping uvicorn process..." + kill -15 "$uvicorn_pid" # Send SIGTERM + else + echo "No uvicorn process running." + fi git pull pip3 install -r requirements.txt