Automate Static Site Build with a pipeline attached to Source Version Control

Hey all,

A little late, but this has been on my to do list for too long and it should (fingers crossed) be easy to do.

I have a blog/website of MD (markdown) files. I previously used Hexo to build that into a static HTML site.

Idea here is that since my MD files are in git, if I push this to bitbucket (or wherever) and have an action that will automatically build and then with the build site, push that to the web host!

Presently I use bitbucket and a plain old nginx instance on a linode instance. I will probably need to go back and upgrade that linux distro. As I am sure it’s out of Long term support. So always nice to have a slight detour for a simple job!

Just a small update.

I am just migrating to Hugo build, rather than Hexo I use previously. I’ve found that it seems to have less teething issues and support on my system.

I am mostly using the following docker image to build the site: GitHub - klakegg/docker-hugo: Truly minimal Docker images for Hugo open-source static site generator.

I have managed to copy over the MD files from Hexo and it just worked. Which is great!

I’m leaving templates alone, as that seems to be what causes the most headaches when i tried using something else. Maybe just change the CSS a little on the default ananke theme.

Next I was going to see if I could use bitbucket’s build pipeline. But that leaves me wondering how it would transfer the static files it builds to my webserver.

Rather than it “Pushing files”, my webserver can pull it, but it may be easier for my site to just pull the git Repo and build it on any changes.

Bitbucket has deployment keys that allow Read-only access so this may be a safer way to do things for the time being.

You could take a look at services like Netlify and CloudFlare pages. I’ve used both in the past and they work great. My blog is currently deployed via CF Pages because I like their options to have serverless functions as well and their folder structure based routing for them. Definitely would consider those as they’re free and require 0 maintenance on your end.

My blog is built with Hugo as well.
Fwiw, here’s the blog: https://mirceanton.com/
And heres the github repo: GitHub - mirceanton/mirceanton.com: My personal blog and website, all thanks to hugo!

Maybe you can get some ideas from there. Let me know how it goes!