I setup Github Actions workflow for this blog to automate the publishing. Actions were new to me, this was a fun learning activity.
I had to write a new one because I could not find an existing action which filled my needs. Here is how it is setup:
My content, hugo config stays in the root of
masterbranch and published site is at root of
Every commit on
mastershould trigger a publish and non
mastercommits should be ignored. For them, I use netfliy deploy previews.
gh-pagesshould preserve history. Some actions delete the existing history.
Since every commit on
gh-pagesreflects a commit from
master, I wanted each of these commits to have the same commit message which triggered the build.
I have made this Github Action available here - hugo-publish