René Welches

TECH NOTES TO MYSELF

Part 3 - Cost-Effective Blog Previews with GitHub Pages and Actions

How I save Netlify credits by using GitHub Pages for preview deployments

When I first set up my Hugo blog on Netlify, I loved the automatic deploy preview feature for pull requests. However, I quickly realized that each preview deployment consumes free tier credits (currently 300 credits/month). With frequent updates and iterations, I was burning through my monthly allowance faster than expected.

Rather than upgrading to a paid plan for something I only needed once in a while, I implemented a dual-deployment strategy: GitHub Pages for previews, Netlify for production. This approach gives me unlimited preview deployments while keeping my production site on Netlify’s excellent CDN.


Part 2 - Deploying Your Hugo Blog to Netlify

A complete guide to publishing your Hugo site from GitHub to Netlify

After building your Hugo blog locally, the next step is getting it online for the world to see. Netlify makes this process incredibly smooth with automatic deployments from GitHub. In this guide, I’ll walk you through deploying your Hugo site to Netlify, including a crucial step: creating the netlify.toml configuration file.

Why Netlify?

Netlify offers several advantages for hosting static sites like Hugo blogs:

  • Free tier with generous limits
  • Automatic deployments from Git commits
  • Built-in CDN for fast global delivery
  • HTTPS by default
  • Custom domains support
  • Deploy previews for pull requests

Prerequisites

Before we begin, make sure you have: