How to deploy a Hugo site to S3

Hi folks, I’m enjoying Hugo and spent some time setting up my new Hugo site deployment to AWS S3 using GitHub actions.

It ended up being a fairly involved process which I decided to detail step by step in this walkthrough: How to deploy a Hugo site to S3 in 2024.

In this guide I cover:

  • Web Hosting in AWS
    • Hosting in S3
    • DNS in Route53
    • Secure and Fast Communication using CloudFront
  • Continuous Deployment to S3 with GitHub Actions
    • Authentication and Authorization between GitHub and AWS
    • GitHub Actions Workflow

I hope this will be useful to peeps embarking on the same journey. Happy to clarify any part of it if needed.

2 Likes

Very interesting Jerome. I am wondering though why you opt for AWS, which I used in the past, vs Netlify.

AWS was getting too complex for me the reason I moved to Netlify.

Regards, Alfred

Hi there Alfred,

I chose AWS primarily because:

  • I have an existing footprint in AWS (beyond static site hosting).
  • The mix of control Vs. complexity of AWS match my need (beyond this use case).
  • I focused my learning budget on Hugo (mostly) and GitHub Actions (secondary).

I hope this answers your question.
Regards, Jerome