Build and deploy Jigsaw site with Github Actions

13 July, 2020

I built this very site about 2 years ago. From that moment till today, I used to run a small shell script locally to deploy it to GitHub pages. Here's what I used to do-

I was building the assets first, then build the site locally for production in the build_production folder. I run this website in a custom domain, so I used to have a CNAME file in the root of /source directory.

Couple of month ago, GitHub launched it's CI/CD platform named GitHub Actions. Today, I had some time to kill, so I thought why not give it a try. So, here's what I did-

I create a file named build-publish.yml in .github/workflows folder. Then still the build script from James Brooks' site and modify a little bit. After that it just works. Kudos to James. The process is basically the same, install composer dependencies, install npm dependencies, run npm build for production, run jigsaw build for production and then move the build_production folder to master branch.

So, I no longer have to build it locally and I don't need to think about CNAME.

Chao!