This is an starting point for a Hugo blog with deployment to Amazon S3 via GitHub Actions.
It's how I deploy nathany.com, Edmonton Go, and fsnotify.org.
Local development:
Remote:
hugo new site <mysite>
creates a config.toml and a few empty folders. I've added .gitkeep files so those folders are checked in.assets/sass
folder with all.sass
that will be converted to css../watch.sh
..gitignore
to avoid committing the generated files..github/workflows/build.yml
).GitHub Actions automatically deploy the website when changes are merged to the master branch on GitHub. In my experience, deploys take a few seconds to complete.
This bucket policy provides public access to the files in S3.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::hugo-deploy-example/*"
]
}
]
}