I wanted SSL certs on my GitHub pages site (this website actually), which GitHub pages doesn’t support - GitLab does. The CI advantage actually came for free (it’s not a feature of GitLab that I had on my roadmap to explore).
Unfortunate timing with the recent GitLab pages security issue, but it doesn’t seem to have affected my site yet.
The migration of my site to GitLab was easy, using their example Hugo generators:
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/c image: registry.gitlab.com/pages/hugo:latest test: script: - hugo except: - master
My previous workflow with GitHub pages was:
- Push Hugo markdown to the
public, the HTML contents
- Run a shell script to push
master, which is displayed on GitHub pages
The workflow now is:
- Push markdown on
My resume is in Latex, in a separate project. Bulding it involves installing an unweildy Latex toolchain (lots of texlive packages, etc.).
Also, manually running
cp resume.pdf /path/to/website/repository/static and creating a separate release to publish the new resume to my website was another imperfect flow.
I tried to chain CI builds, i.e.:
- Get the GitLab CI build for my resume project to create
resume.pdfas an artifact
- Using GitLab hooks, trigger a CI build for my website project after every resume build
From the docs, it wasn’t clear but I think that multi-project CI is a feature of paid GitLab and not community GitLab.
I settled on merging the two repositories.
I found a Dockerhub image that contained everything latex in it, so I decided to use the latex image and fetch Hugo into it, to create a unified resume/website builder container:
sevagh:sevag.xyz $ cat .gitlab-ci.yml image: aergus/latex pages: script: - wget -O- https://github.com/gohugoio/hugo/releases/download/v0.36/hugo_0.36_Linux-64bit.tar.gz | tar -xvzf - - make gitlab_build artifacts: paths: - public only: - master
Here’s the Make rule
gitlab_build: resume localhugo resume: make -C ./resume/ clean && make -C ./resume cp resume/pdf/resume.pdf ./static/ hugo: hugo localhugo: ./hugo