GitLab Pages is a feature that allows you to host static websites directly from your GitLab repository. It’s often used for project documentation, blogs, or any other content that can be served as static files (HTML, CSS, JS).

How GitLab Pages works

GitLab Pages works by taking the static files generated by your pipeline, storing them as artifacts, and then serving them through a dedicated domain (https://bicorush-b6fede.gitlab.io/).

The process involves:

  1. Generating content (e.g., documentation, static site files).
  2. Storing the output in a folder named public.
  3. Defining the pages keyword in your pipeline.
  4. GitLab then picks up the content from the public folder and deploys it.

How to use GitLab Pages in a pipeline

To enable GitLab Pages, you need a job in your CI/CD pipeline that generates the content and moves it into the publicfolder. Here’s a basic example:

docs:

stage:

build

script:

- dart doc .

- mkdir -p public

- mv doc/api/* public/

pages: true

artifacts:

paths: