Deploy MkDocs to GitHub Pages #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy MkDocs to GitHub Pages | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
types: [opened, synchronize, reopened, edited] | |
workflow_dispatch: | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Install the project | |
env: | |
UV_INDEX_URL: https://pypi.org/simple | |
UV_EXTRA_INDEX_URL: "" | |
run: uv sync --all-extras --dev | |
- name: Build site with MkDocs | |
run: uv run mkdocs build | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site | |
- name: Deploy (only on push to master) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
id: deploy | |
uses: actions/deploy-pages@v4 |