Skip to content

pages#

Overview#

Publish static sites to GitLab Pages.

The pages pipeline publishes the contents of a public directory to GitLab Pages on the default branch. This ensures that documentation is always being built, but only published when desired.

View the example site.

Usage#

Include the pipeline in your .gitlab-ci.yml file:

gitlab-ci.yml
include:
  - project: brettops/pipelines/pages
    file: include.yml

Examples#

Publish a MkDocs site#

Add a mkdocs.yml config and a docs folder to the root of your project.

Then add the following to your .gitlab-ci.yml file:

gitlab-ci.yml
include:
  - project: brettops/pipelines/mkdocs
    file: include.yml
  - project: brettops/pipelines/pages
    file: include.yml

Publish anything#

You can publish anything you like by placing it in the public directory and saving as an artifact:

stages:
  - test
  - build
  - deploy

include:
  - project: brettops/pipelines/pages
    file: include.yml

totally-custom-job:
  stage: build
  image: ${CONTAINER_PROXY}alpine
  script:
    - mkdir public
    - touch public/index.html
  artifacts:
    paths:
      - public/