fix: Update documentation setup with analytics and improved checks #14
Workflow file for this run
This file contains 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: Documentation | |
on: | |
push: | |
paths: | |
- "docs/**" | |
- "**.md" | |
- "mkdocs.yml" | |
- "requirements-docs.txt" | |
- "scripts/check_docs.py" | |
branches: | |
- main | |
pull_request: | |
paths: | |
- "docs/**" | |
- "**.md" | |
- "mkdocs.yml" | |
- "requirements-docs.txt" | |
- "scripts/check_docs.py" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-docs.txt | |
- name: Check documentation | |
run: | | |
python scripts/check_docs.py | |
- name: Create site directory | |
run: mkdir -p site | |
- name: Ensure js directory exists | |
run: | | |
mkdir -p docs/js | |
- name: Build documentation | |
run: | | |
mkdocs build --strict --verbose | |
- name: Deploy Documentation | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
mkdocs gh-deploy --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload documentation artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation | |
path: site/ | |
if-no-files-found: warn | |
retention-days: 14 |