How I Switched from Using GitHub to Netlify

Recently, I decided to switch my blog hosting from GitHub Pages to Netlify, and here’s why. I had set up GitHub Actions to build my Hugo site and deploy it to the gh-pages branch. We don’t use Jekyll, and I made sure GitHub Pages was configured to serve the site from the built branch — not using GitHub’s default Jekyll build system. But despite that, something odd kept happening. Just before the GitHub Action could finish and push the Hugo-built site, GitHub Pages’ default Jekyll builder would sometimes run automatically — even though we weren’t using it. The result? It would overwrite the gh-pages content, and my index.html would mysteriously vanish. ...

April 26, 2025 · 1 min · Rohan

How I Deployed My Hugo Blog on GitHub Pages

Introduction In this guide, I’ll walk you through the process of deploying a Hugo blog to GitHub Pages, with an optional custom domain (e.g., blog.rohanbatra.in). By the end of this guide, you’ll have your static Hugo website hosted on GitHub Pages, and you can customize it further as needed. Prerequisites Before starting, make sure you have the following: Git: Ensure Git is installed on your computer. You can download it here. Hugo: Install Hugo on your machine. You can follow the instructions on the official Hugo website. GitHub Account: Make sure you have a GitHub account. Domain Name (optional): If you want to use a custom domain (e.g., blog.rohanbatra.in), have access to your domain registrar’s DNS settings. Step 1: Create a New Hugo Site If you haven’t already created a Hugo site, follow these steps: ...

April 26, 2025 · 4 min · Rohan