Site Publishing - Matt Whipple

This site is published using GitLab Pages(1).

The documentation for GitLab pages(1) is overall solid but it seems fairly example heavy which leaves the need for a fair amount of inference based on those examples, though the reference documentation seems fairly compehensive. The publishing itself is handled by a .gitlab-ci.yml file and is tied to a “specific job called pages” within that file(2).

.gitlab-ci.yml

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 (3).

workflow:
  rules:
    - if: '$CI_COMMIT_BRANCH'

The special pages job is defined which should be run during the deploy stage (3).

pages:
  stage: deploy

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

  script:
    - echo 'Nothing to do...'

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

  artifacts:
    paths:
      - public

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

  rules:
    - if: '$CI_COMMIT_BRANCH == "master"'
1.
GitLab pages | GitLab [online]. 21 April 2021. Available from: https://docs.gitlab.com/ee/user/project/pages/
2.
Keyword reference for the .gitlab-ci.yml file | GitLab #pages [online]. June 2021. Available from: https://docs.gitlab.com/ee/ci/yaml/README.html#pages
3.
Create a GitLab pages website from scratch | GitLab [online]. 30 May 2021. Available from: https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_from_scratch.html