Hugo site automation with Cloud Build
Introduction
In this post I collate the blog posts on building static sites with Hugo and Cloud Build for easier reference. At the beginning of the process, I wanted to experiment with using Hugo. As time progressed I found it to be an awesome piece of software. In addition I also wanted to utilise Cloud Build to automate the very manual process of blog deployment.
Cloud Storage
- Create a (multi-region) Cloud Storage Bucket
- Add permissions for website to the bucket
Blog Creation
- Create a static site using Hugo.
- Add the static site to source version control e.g. GitHub
- Reference: Blogging with Hugo.
Cloud Build
- Create a Hugo image
- Link Cloud Build to the static site under source version control
- Create a
cloudbuild.yaml
configuration for Cloud Build - Add the yaml configuration to the source control
- Create a Cloud Build trigger to reference the cloudbuild.yaml
- Reference: Building an image with Cloud Build.
- Reference: Deploying a Hugo Blog with Cloud Build.
Blogging
- Add Blog entries to source version control
- Site will automatically deploy based on the Cloud Build trigger configuration
References
It may be helpful to read the prior blog posts on Hugo, Containers and automation on Google Cloud:
- Reference: Blogging with Hugo.
- Reference: Building an image with Cloud Build.
- Reference: Deploying a Hugo Blog with Cloud Build.
- Reference: Setting up a custom site.
- Reference: Creating a static website in Google Cloud Storage.