Repository for www.stevenhancock.ca
Site created using Hugo
See for some options https://gohugo.io/getting-started/quick-start/
Hugo Theme from https://themes.gohugo.io/theme/minimal/
- Create a new article inside
content/articles
by either using the commandhugo new articles/article-name.md
or copying and editing an existing article. - Commit to git branch.
- Wait. Cloud build should automatically pick up what was pushed to Master and deploy to cloudstorage. See
cloudbuild.yaml
andDockerfile
for the finer details. Worth noting that commits to the Master branch will show up at www.stevenhancock.ca while commits to all other branches will be deployed to test.stevenhancock.ca/
Start Hugo Server
hugo server -D
Create a new article
hugo new articles/article-name.md
Create public files for adding to GCP Cloud Storage
hugo
See: https://cloud.google.com/storage/docs/hosting-static-website & https://cloud.google.com/storage/docs/best-practices & https://cloud.google.com/load-balancing/docs/https/adding-backend-buckets-to-load-balancers
gsutil -m cp -r public/* gs://test.stevenhancock.ca/
gsutil web set -m index.html -e 404.html gs://www.example.com
cloudbuild.yaml
To be able to interact with cloud storage from the container that cloud build creates you'll need to credentials. Use secrets to get these credentials.
Using GitHub Triggers we can automate cloud build on git commits.
I'm using a load balancer to enable https for the site.
Some usefull links that helped to get SSL setup for static cloud hosting: