Intro
CI/CD Fundamentals
.gitlab-ci.yml Basics
GitLab Runners
GitLab Executors
Specific Runners
Artifacts
Documentation Generation
Monitoring
4. Deploying Documentation to GitLab Pages
Once your documentation is ready, you can set up GitLab CI/CD to automatically build and deploy it to GitLab Pages.
Practical Exercise
-
Create a
.gitlab-ci.yml
File:- In your project root, create a
.gitlab-ci.yml
file with the following content:image: python:3.8 pages: stage: deploy script: - pip install mkdocs - mkdocs build -d public artifacts: paths: - public
- In your project root, create a
-
Push Changes to GitLab:
- Commit your changes and push to your GitLab repository:
git add . git commit -m "Set up MkDocs and GitLab CI/CD" git push origin main
- Commit your changes and push to your GitLab repository:
-
Access GitLab Pages:
- After the pipeline runs successfully, navigate to
Settings > Pages
in your GitLab repository to find the URL of your deployed documentation.
- After the pipeline runs successfully, navigate to