name: Deploy MkDocs on: push: branches: - main # or master, depending on your default branch workflow_dispatch: permissions: contents: write jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | pip install mkdocs-material pip install mkdocs-git-revision-date-localized-plugin pip install mkdocstrings[python] - name: Configure Git run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Build docs run: mkdocs build - name: Deploy to GitHub Pages run: | git checkout --orphan gh-pages git rm -rf . mv site/* . rm -rf site git add . git commit -m "docs: Update documentation" git push origin gh-pages --force