ctx / .github /workflows /docs.yml
Stevesolun's picture
Sync ctx 4f0c3de
21ff762 verified
name: Deploy docs to GitHub Pages
# Build the MkDocs Material site and publish to GitHub Pages on every push
# to main. Also deployable on demand via the workflow_dispatch trigger.
on:
push:
branches:
- main
paths:
- "docs/**"
- "mkdocs.yml"
- "requirements-docs.txt"
- ".github/workflows/docs.yml"
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
# GitHub Pages requires these permissions on the deploy job.
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deploy; cancel in-progress runs on a new push.
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0 # Required by mkdocs git-revision plugins if added.
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: requirements-docs.txt
- name: Install docs dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-docs.txt
- name: Build site (strict)
run: |
python -m mkdocs build --strict
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5