nathany / hugo-deploy

Example deployment to S3 for Hugo blogs.
http://hugo-deploy-example.s3-website.ca-central-1.amazonaws.com/
BSD 2-Clause "Simplified" License
76 stars 7 forks source link
amazon-s3 deploy hugo static-site

Hugo Deploy

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.

Requirements

Local development:

Remote:

What Is Provided?

Deployment

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/*"
            ]
        }
    ]
}