Why I Chose Direct Upload with Wrangler Over GitHub Integration for Cloudflare Pages

anna kutukova H uWVHHnyOU unsplash scaled
Genx Avatar

Cloudflare Pages is famous for its seamless integration with GitHub: push code, and your site rebuilds automatically—no manual steps needed.

So, why would a developer deliberately avoid the GitHub integration and use direct upload with Wrangler instead?
Here’s why I made the switch, and why it might help you too.


🚦 Problem: Slow, Redundant Builds with GitHub Integration

At first, I set up my Hugo static site to deploy via Cloudflare’s GitHub integration. In theory, this workflow is super convenient:

  • Push to GitHub → Your site is cloned and (re)built on Cloudflare’s servers
  • No local build artifacts required

But in real-world projects—especially with static generators that process lots of images, or have nontrivial build steps—this system has some real downsides:

1. No Build Caching: Images are Reprocessed Every Time

  • Each Cloudflare build starts from scratch, always.
  • All images and assets are rebuilt/optimized on every deploy, even if they almost never change.
  • Processing 100+ images (like in my Hugo blog) would take several minutes—even for a one-line content fix.

2. You Wait for a Remote Build (Even if You Tested Locally)

  • Cloud Build means you run the exact same, slow build twice: once locally to test, again in Cloudflare’s container.
  • Any post-processing (like Pagefind search index generation) also runs in that container, not locally.
  • If the build fails in the cloud, you may need to debug with remote logs.

3. Large Repositories = Slower Clones, Higher CI Latency

  • Big public/ folders, tons of images, or heavy repositories lead to slower repository clone times and longer queues.

🚀 Solution: Direct Upload Using Wrangler

Direct upload flips the workflow:

  • You build locally.
  • You test and optimize everything on your environment.
  • You upload only the finished, static files (the public/ folder) to Cloudflare using Wrangler, skipping all remote build steps.

Benefits:

  • ✨ No unnecessary image processing in the cloud
  • ⚡ Much, much faster deploys—just upload, no build
  • 🌱 Lower risk of cloud-side build failures
  • 🎛 Full control over optimization and generated files

🏆 Summary Table

GitHub IntegrationWrangler Direct Upload
Build ModeCloud (CI/CD)Local Build
Image ProcessingEvery deploy, in cloudOnce, local (your machine)
Deploy SpeedSlow for many assetsInstant (just upload)
Failure DebugCloud logsLocal, immediate
Use CaseSimple, light sitesMedia-heavy/custom pipelines

✋ When Should You Use Wrangler Direct Upload?

  • You have lots of images or heavy build/image-processing steps
  • Your site build takes more than ~1 minute on Cloudflare
  • You want to fully control the build and test locally before deploy
  • You need faster, more reliable deploys for static assets

Cloudflare’s GitHub integration is fantastic for simple sites (like most docs or JS apps). But for modern static sites with complex asset pipelines, direct upload with Wrangler provides a better developer experience and way less CI friction.


In short:
If build time in the cloud is hurting your productivity, consider Wrangler direct uploads for speedy, reliable, and local-first deployments.

Share This Post:

Genx

in

Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

11 − ten =

Webmention: Have you posted a response to this article? Let me know the URL: