Albin Larsson: Blog

Culture, Climate, and Code

Building and deploying Snowman sites with Gitlab Pages

14th February 2024

I have previously written about how to build Snowman sites on Github Actions. Yesterday I had to figure out not only how to build Snowman sites on Gitlab Pages but also how to deploy them. Not only was the Gitlab CI/CD configuration a joy compared to Github Actions, but it integrats well with the Gitlab Pages service to the extent that any Snowman site should be able to build and deploy with the following .gitlab-ci.yml configuration:

# The Docker image that will be used to build your app
image: debian:bookworm
# Functions that should be executed before the build script is run
  - apt-get update && apt-get install --yes ca-certificates && apt-get install --yes wget
  - wget
    -O snowman && chmod +x snowman
    - ./snowman build
  publish: site
      # The folder that contains the files to be exposed at the Page URL
      - site

    # This ensures that only pushes to the default branch will trigger
    # a pages deploy

Now if you want to build it with local RDF files you would need to setup Oxigraph or another SPARQL service just like in the Github Actions example. I haven’t needed that yet so I leave that exercise to the reader.

Related posts