Rebranding and Redeploying a Legacy Hugo Website with Netlify and AWS

Table of Contents
Introduction
A new client approached us to rebrand their large static website built with Hugo. The original project was deployed years ago, and the previous developer was no longer available. The client needed to start fresh: new GitHub repository, modern CI/CD setup, and clean staging and production environments.
They knew the site was hosted using Netlify for staging and AWS S3 + CloudFront for production, but had no idea how the environments were connected or deployed.
We stepped in to analyze, reconfigure, and redeploy both environments using GitHub Actions, Netlify, and AWS infrastructure, restoring full control and confidence in just a few hours.
Understanding the Legacy Setup
We began by thoroughly reviewing the original GitHub repository and deployment logic:
- Analyzed GitHub Actions and identified workflow triggers and deployment steps
- Reviewed the existing
netlify.tomland custom Hugo build settings - Traced references to AWS S3 buckets and CloudFront distributions
Our audit gave us a complete picture of the CI/CD flow, and helped us isolate what needed to be updated, rebuilt, or migrated.
What We Did
🔧 GitHub Repository Cleanup and CI/CD Setup
Created a new GitHub repository
We initialized a clean repo to host the rebranded version of the Hugo website.Recovered and cleaned up helper branch used in CI
The legacy deployment workflow depended on an undocumented helper branch that had a different file structure from the main branch. By carefully analyzing the GitHub Actions configuration, we discovered its role and recreated it to match the CI expectations. Since the branch was checked out from the main branch, we also cleaned up unnecessary files to avoid conflicts and ensure a clean build pipeline.Configured Action Permissions and Secrets
We ensured the proper permissions were in place and securely stored secrets for both Netlify and AWS integrations.
🧪 Staging Environment with Netlify
Set up a new Netlify site
We connected the repo to a new Netlify site and pointed it to the staging domain.Configured build environment
Specified the correct Hugo version, environment variables, and OAuth provider setup.Integrated DecapCMS (formerly Netlify CMS)
We connected DecapCMS to the new site, enabling in-browser content editing for the client’s team.
🚀 Production Deployment with AWS
Set up AWS S3 buckets
- One main bucket for the
wwwdomain with static website hosting enabled - One redirect bucket for the root domain to redirect to
www
- One main bucket for the
Provisioned CloudFront distributions
We connected S3 with CloudFront for global CDN support and better performance.Configured DNS with Route 53
AddedArecords pointing to CloudFront distributions for both root and subdomain.Created limited IAM user
We set fine-grained permissions for deploying only to S3 and managing CloudFront cache invalidations.
The Outcome
Despite having zero access to the original developer and minimal documentation, our team successfully:
- Audited and modernized the entire CI/CD pipeline
- Established a clean, maintainable GitHub Actions workflow
- Set up isolated and reliable staging and production environments
- Enabled the client to manage content using DecapCMS
- Ensured security by applying least-privilege principles to AWS IAM
We encountered multiple blockers during the process, from GitHub OAuth issues to CloudFront DNS propagation delays, but resolved them all swiftly, and had the site fully rebranded and deployed within a few hours.
Technologies Used
- Hugo static site generator
- GitHub Actions for CI/CD
- Netlify for staging environment
- DecapCMS (formerly Netlify CMS)
- AWS S3 for static hosting
- AWS CloudFront for CDN
- AWS IAM for secure permissions
- AWS Route 53 for DNS management