Skip to content
AWS infrastructure for building and deploying Hugo websites
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status Go Report Card MIT

Infrastructure-as-Code for a pipeline for building and deploying Hugo websites in Amazon Web Services.

What do you need already?

  • Each of your Hugo websites' source code in a separate GitHub repository. Private repositories are okay.
  • A Route53 Hosted Zone for each website's domain.

What does this deploy?

For each website, in a nutshell:

  • A CodePipeline pipeline for pulling website source from GitHub, building it, testing it, then publishing to S3.
  • A TLS (HTTPS) certificate for the domain.
  • A CloudFront distribution, with Lambda functions to handle:
    • Redirecting http to https.
    • Redirecting the www. subdomain to the root domain.
    • Reading index.html if the client requests a directory.


  1. Download and unpack the latest release build.
  2. Rename sample-config.yml to config.yml and add your websites.
  3. Rename sample-secrets.yml to secrets.yml and add your secrets.
  4. Run hugo-aws and cross your fingers. You should expect ~30 minutes per website for this initial deployment.

Each website will build and deploy automatically on commit to the master branch.


  • UX testing and feedback on the deployment process.
  • Email alert when a build/test/deploy fails.


Obviously, huge credit to the Hugo project. Thank you!

This project also uses the following projects:

Licence, credit & sponsorship

This project is published under the MIT Licence.

You don't owe me anything in return, but as an indie freelance coder there are two things I'd appreciate:

  • Credit. If your app or documentation has a credits page, please consider mentioning the projects you use.
  • Cash. If you want and are able to support future development, please consider becoming a patron or buying me a coffee. Thank you!
You can’t perform that action at this time.