From ef6a134cf9fc13c10c8d92e06cc4eae4d1f2644d Mon Sep 17 00:00:00 2001 From: Darrel Pol Date: Fri, 20 Sep 2024 22:05:34 -0500 Subject: [PATCH] setting port as env --- .github/workflows/on_merge_to_master.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on_merge_to_master.yaml b/.github/workflows/on_merge_to_master.yaml index e1016e87c..b221540c0 100644 --- a/.github/workflows/on_merge_to_master.yaml +++ b/.github/workflows/on_merge_to_master.yaml @@ -5,6 +5,8 @@ on: push: branches: - main # Trigger on push to main branch +env: + STABLE_DIFFUSION_API_PORT: 7861 jobs: deploy: @@ -25,7 +27,7 @@ jobs: cd /home/ec2-user/apps # Terminate any running instances of the Python app - PORT=7860 + PORT=${{ env.STABLE_DIFFUSION_API_PORT }} PID=$(lsof -t -i:$PORT) if [ ! -z "$PID" ]; then echo "Terminating process running on port $PORT with PID $PID..." @@ -74,7 +76,7 @@ jobs: cd .. # Run the application in the background using nohup - nohup python launch.py --nowebui --deforum-api --listen --api --port 7861 > nohup.out 2>&1 & + nohup python launch.py --nowebui --deforum-api --listen --api --port $PORT > nohup.out 2>&1 & # Detach from the SSH session to prevent hanging exit