GitLab Pages Deployment¶
Automatische Deployment¶
GitLab Pages wordt automatisch geconfigureerd via .gitlab-ci.yml. Wanneer je naar de main of master branch pusht, wordt de documentatie automatisch gebouwd en gehost.
Hoe het werkt¶
- Push naar main/master branch
- GitLab CI/CD draait automatisch de
pagesjob - MkDocs build genereert de statische site in
public/folder - GitLab Pages host de site automatisch
URL¶
Na de eerste succesvolle pipeline is je documentatie beschikbaar op:
Of als je een custom domain hebt:
Handmatig Builden (lokaal)¶
Als je lokaal wilt testen hoe het eruit ziet:
# Build voor GitLab Pages (output naar public/)
npm run docs:build:gitlab
# Of direct
mkdocs build --site-dir public
Configuratie¶
De GitLab CI/CD configuratie staat in .gitlab-ci.yml:
pages:
stage: pages
image: python:3.11
script:
- pip install -r requirements-docs.txt
- mkdocs build --site-dir public
artifacts:
paths:
- public
only:
- main
- master
Probleemoplossing¶
Pages job faalt¶
- Check of
requirements-docs.txtbestaat - Check of
mkdocs.ymlcorrect is - Check de GitLab CI/CD logs voor foutmeldingen
Documentatie niet zichtbaar¶
- Ga naar Settings > Pages in je GitLab project
- Check of de
pagesjob succesvol is afgerond - Wacht een paar minuten (GitLab Pages kan even duren om te deployen)
Custom Domain¶
- Ga naar Settings > Pages
- Voeg je custom domain toe
- Configureer DNS records zoals aangegeven
Verschil met GitHub Pages¶
- GitLab Pages: Automatisch via CI/CD pipeline (geen extra actie nodig)
- GitHub Pages: Vereist
mkdocs gh-deploycommando of GitHub Actions
Beide methoden werken, maar GitLab Pages is geïntegreerd in je bestaande CI/CD pipeline.