Is there a way to run BUILDS (e.g., npm run build) without them counting as DEPLOYMENTS

TL;DR: Is there a way to run BUILDS (e.g., npm run build) without them counting as DEPLOYMENTS (500 free limit)? Hey, I've been diving into Cloudflare Pages and making good progress, but I've got a question I can't seem to figure out. What's the way to run builds (to produce static pages with any framework featuring SSG functionalities, like Next.js, Astro, etc.) without having to deploy everything? I tried deployment hooks, but it seems they execute the entire deployment process, which I assume counts towards the limit. I read about using Wrangler publish, but upon checking the guide, it seems those options have changed. I'll keep researching, but maybe someone can lend me a hand with this. The general idea of the project is that I use a framework to generate static pages, with a command similar to npm run build or npx run build, etc. I'd like to be able to run just the build without going through the entire deployment process, which, besides counting towards the monthly deployment limit (500 free tier and 5000 paid), seems unnecessary. For example, I noticed that every deployment clones the GitHub repo and runs npm install, right? Thanks a lot; I hope you can assist me.
1 Reply
Walshy
Walshy7mo ago
If you trigger a build, it'll count to the build limit. If we have to spin up a build, we need to count it (it isn't cheap spinning up thousands of containers haha) You can use Wrangler to publish it yourself, you can see the guide for that here: https://developers.cloudflare.com/pages/get-started/direct-upload/#wrangler-cli Direct Upload (Wrangler) does not count towards the build limit as it does not create a build.
Cloudflare Docs
Direct Upload · Cloudflare Pages docs
Upload your prebuilt assets to Pages and deploy them via the Wrangler CLI or the Cloudflare dashboard.
Want results from more Discord servers?
Add your server