From c526dbbe68d3ea9fe743c5df33b2617be44f58a3 Mon Sep 17 00:00:00 2001 From: RezenkovD Date: Wed, 24 Jan 2024 21:44:48 +0200 Subject: [PATCH] fix: replace pkill to script --- .github/workflows/ci-cd.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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