Yesterday I covered the overview of how this gets deployed. Now for the detail.
The script for testing is more aspirational than functional. It runs a spellcheck on the blog, but doesn’t die if it finds any. I’m supposed to read the output. I never do. I should though. Someday I’ll add consequences to the spellcheck run, but for now at least it tries.
Next up is the script that does the build and deployment to pages.
This is rather simple. It does the
make publish step but does a bit
to reset the base url. The resulting
public/ dir is marked as an
artifact to work with the gitlab pages system.
Note that this and the deploy job use a custom
container. The main change is that I’ve installed and built
hugo in it. There are some other tools and bits in there,
but for this project it’s hugo being there that matters.
The last step is a deploy which is done by getting credentials
from the Gitlab CI’s protected variables. Then it’s just
git push. The actual building of the blog is done via
a git hook on the server.
There are obvious improvements to be made. Ones that come to mind:
- The test step should fail on failures.
- Add a link checker to a scheduled build to check for dead links.
- Add a deploy checker to make sure the server side build job completed.