r/webdev • u/Low-Insurance-3678 • 22d ago
Question ci/cd pipeline issue
hi everyone
I have a ci pipeline where i run build and deploy to cf workers, everytime the build runs it succeeds but it stays hanging on and the next job does not run( see image), it can stay hanging on for hours and it won’t exit at all till i cancel the workflow
i have added a timeout to exit after 2 mins and a continue on error set to true to be able move to the next run which is deploy the worker
2- the deploy runs: npm run deploy:vinext
and it always exits with a message “wrangler versions upload” and the whole ci fails now
but after i check on my cloudflare dashboard i actually find that deploy
running these on terminal manually actually does the work but it’s not what i want
is there any solution that will make the build exit after it finishes and make the deploy works fine
tech: Nextjs app migrated to Vinext
- name: Build Vinext app
env:
CLOUDFLARE_INCLUDE_PROCESS_ENV: true
timeout-minutes: 1
continue-on-error: true
run: npm run build:vinext
- name: Deploy to cf
env:
CLOUDFLARE_API_TOKEN: ${{ env.CLOUDFLARE_API_TOKEN }}
run: npm run deploy:vinext
scripts:
"build:vinext": "vite build",
"start:vinext": "infisical run --env=prod -- vite preview --port 3000",
"deploy:vinext": "vinext-cloudflare deploy --warm-cache --skip-build",
"deploy:response-store": "cf deploy --prebuilt --mode production --worker frontend-response-store"
2
u/kdjayakody 22d ago
I would remove the timeout and continue-on-error first, since they mask the failure and can let deploy run with a stale or incomplete artifact. In the build step, log the exit code and inspect which child process is still alive; a build command should exit once its work is done. Then give build and deploy separate jobs with explicit success conditions, and verify the deploy command’s final exit code rather than relying only on the dashboard showing a deployment.
2
u/Guilty-Olive-8827 22d ago
what is `r //lang`? i've stared at that step for a solid minute trying to work out if it's an alias you set up or a typo that somehow worked
2
u/Geraldwelly 22d ago
The prerender wildcard is the first thing I'd isolate. Run Vite's build API in a tiny Node wrapper, await build(), then log process.getActiveResourcesInfo(); if it resolves with an FSWatcher, Timeout, or server handle still open, a plugin or prerender hook is keeping Node alive. Temporarily disable prerendering and bisect the plugins. Keep continue-on-error off while debugging, or the deploy can proceed with a stale artifact.
2
u/jr_70904 21d ago
The build wasn't hanging after it finished; it was still trying to prerender the Supabase routes. `*` is doing a lot of work there. Keep those routes dynamic, then debug Wrangler's exit separately - a deployment showing up in the dashboard doesn't mean CI got a clean exit.
3
u/quizical_llama 22d ago
your going to need to post some code if you want help.
1
u/Med-Bechir 18d ago
That timeout plus continue-on-error is hiding the exit. Vite is likely leaving a handle open so CI never finishes, and that wrangler versions message is normal output your script treats as fail. Can you paste the exit code and wrangler version from the deploy log?
2
u/[deleted] 22d ago
[removed] — view removed comment