Skip to content

Documentation

Builds an mkdocs site and publishes it to GitHub Pages.

This workflow is part of the nolte/cookiecutter-gh-project template.


Usage

.github/workflows/release-cd-deliver-docs.yml
on:
  push:
    branches:
      - develop

jobs:
  deliver_docs:
    uses: nolte/gh-plumbing/.github/workflows/reusable-mkdocs.yaml@develop
    secrets:
      token: ${{ secrets.GITHUB_TOKEN }}

GitHub Pages

Ensure the target repository declares has_pages: true. The shared Probot settings already include this—see Settings.


Central configuration

.github/workflows/reusable-mkdocs.yaml
name: Release Deliver Docs

on:
  workflow_call:
    inputs:
      requirements:
        description: 'path of the requirements dependencies file'
        required: false
        default: "./requirements-dev.txt"
        type: string
    secrets:
      token:
        required: true

jobs:
  publish_docs:
    name: "Publish the HTML Documentation"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout master
        uses: actions/checkout@v6.0.0

      - name: Deploy docs
        uses: mhausenblas/mkdocs-deploy-gh-pages@1.26
        env:
          GITHUB_TOKEN: ${{ secrets.token  }}
          REQUIREMENTS: ${{ inputs.requirements }}