Skip to content

Integrate the documentation with GitHub CI

Step 1: Add folder to .gitignore

echo "site/" >> .gitignore

Step 2: Create a two folders in your project

mkdir .github
cd .github
mkdir workflows

Step 3: Create a file called ci.yml and insert the CI configuration

name: ci
on:
  push:
    branches:
      - main
      - master
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - run: pip install mkdocs-material
      - run: mkdocs gh-deploy --force

Step 4: Create a new branch in your GitHub project called for example gh-pages

Step 5: Enable the GitHub pages on your project and select the branch gh-pages as source for your documentation