From 1253779c00a77aa5d328ecc8cca22f995d285aa1 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:28:32 -0600 Subject: [PATCH] Update ci.yaml --- .gitea/workflows/ci.yaml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 2a8637b..b84af1f 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -64,7 +64,16 @@ jobs: # start and detach with logs mkdir -p .next # Use production server with enhanced stability for CI - nohup npm run start -- -p "$PORT" -H "$HOST" > .next/runner.log 2>&1 & + # Start server in background but keep it alive with proper signal handling + ( + # Create a new process group to isolate from CI cleanup + setsid bash -c ' + # Set up signal handlers to prevent premature termination + trap "echo \"🛑 Received signal, shutting down gracefully...\"; exit 0" TERM INT + # Start the server + npm run start -- -p "'$PORT'" -H "'$HOST'" 2>&1 | tee .next/runner.log + ' & + ) & echo $! > .next/runner.pid echo "🌐 PID $(cat .next/runner.pid) listening on http://$HOST:$PORT" @@ -212,7 +221,16 @@ jobs: test -d .next || { echo "❌ Missing .next build output"; exit 1; } mkdir -p .next # Use production server with enhanced stability for CI - nohup npm run start -- -p "$PORT" -H "$HOST" > .next/runner.log 2>&1 & + # Start server in background but keep it alive with proper signal handling + ( + # Create a new process group to isolate from CI cleanup + setsid bash -c ' + # Set up signal handlers to prevent premature termination + trap "echo \"🛑 Received signal, shutting down gracefully...\"; exit 0" TERM INT + # Start the server + npm run start -- -p "'$PORT'" -H "'$HOST'" 2>&1 | tee .next/runner.log + ' & + ) & echo $! > .next/runner.pid echo "🌐 PID $(cat .next/runner.pid) listening on http://$HOST:$PORT" @@ -312,7 +330,16 @@ jobs: test -d .next || { echo "❌ Missing .next build output"; exit 1; } mkdir -p .next # Use production server with enhanced stability for CI - nohup npm run start -- -p "$PORT" -H "$HOST" > .next/runner.log 2>&1 & + # Start server in background but keep it alive with proper signal handling + ( + # Create a new process group to isolate from CI cleanup + setsid bash -c ' + # Set up signal handlers to prevent premature termination + trap "echo \"🛑 Received signal, shutting down gracefully...\"; exit 0" TERM INT + # Start the server + npm run start -- -p "'$PORT'" -H "'$HOST'" 2>&1 | tee .next/runner.log + ' & + ) & echo $! > .next/runner.pid echo "🌐 PID $(cat .next/runner.pid) listening on http://$HOST:$PORT"