Site Publishing - Matt Whipple

This site is published using GitLab Pages(“GitLab Pages | GitLab” 2021). At the moment this involves checking the generated site into the repository which GitLab then publishes, though automated generation will likely be done later.

The documentation for GitLab pages(“GitLab Pages | GitLab” 2021) is overall solid but it seems fairly example heavy which leaves the need for a fair amount of inference based on those examples. The publishing itself is handled by a .gitlab-ci.yml file and is tied to a “specific job called pages” within that file(“Keyword Reference for the .gitlab-Ci.yml File | GitLab #Pages” 2021).


Currently the file uses a standard alpine image with an unpinned version (tsk tsk):

image: alpine:latest

Publishing should only be done for the primary branch so a workflow will be configured to target branches (“Create a GitLab Pages Website from Scratch | GitLab” 2021).

    - if: '$CI_COMMIT_BRANCH'

The special pages job is defined which should be run during the deploy stage (“Create a GitLab Pages Website from Scratch | GitLab” 2021).

  stage: deploy

While no additional preparation is required, a script element is expected and therefore an effective no-op is added:

    - echo 'Nothing to do...'

The (already existing) public directory will be published as an artifact:

      - public

Deployment of updates should only be performed for the primary branch:

    - if: '$CI_COMMIT_BRANCH == "master"'
“Create a GitLab Pages Website from Scratch | GitLab.” 2021.
“GitLab Pages | GitLab.” 2021.
“Keyword Reference for the .gitlab-Ci.yml File | GitLab #Pages.” 2021.