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:


Part 1 - Setting Up a Hugo Blog with the Clean White Theme

A step-by-step guide to creating a Hugo blog from scratch to Deployment

Want to create a beautiful blog with Hugo? This guide will walk you through setting up a Hugo site with the Clean White theme from scratch. We’ll be using Hugo modules (the modern approach) instead of Git submodules.

Prerequisites

Before we start, make sure you have:

Step 1: Create Your GitHub Repository

First, create a new repository on GitHub for your blog. You can name it something like your-username-hugo-blog. This repository will eventually be used to deploy your blog to Netlify (or GitHub Pages).