Hugo site automation with Cloud Build

Share on:

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

  1. Create a (multi-region) Cloud Storage Bucket
  2. Add permissions for website to the bucket

Blog Creation

  1. Create a static site using Hugo.
  2. Add the static site to source version control e.g. GitHub

Cloud Build

  1. Create a Hugo image
  2. Link Cloud Build to the static site under source version control
  3. Create a cloudbuild.yaml configuration for Cloud Build
  4. Add the yaml configuration to the source control
  5. Create a Cloud Build trigger to reference the cloudbuild.yaml

Blogging

  1. Add Blog entries to source version control
  2. 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: