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).
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:
public
.pages
keyword in your pipeline.public
folder and deploys it.To enable GitLab Pages, you need a job in your CI/CD pipeline that generates the content and moves it into the public
folder. Here’s a basic example:
docs:
stage:
build
script:
- dart doc .
- mkdir -p public
- mv doc/api/* public/
pages: true
artifacts:
paths: