Skip to content

Commit

Permalink
add website auto build workflow for mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ProKil committed Nov 6, 2024
1 parent bb78d29 commit 8467bdc
Showing 1 changed file with 15 additions and 37 deletions.
52 changes: 15 additions & 37 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,28 @@
name: website

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
- docs/*
# Alternative: only build for tags.
# tags:
# - '*'

# security: restrict permissions for CI jobs.
permissions:
contents: read

contents: write
jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: '3.13'

# ADJUST THIS: install all dependencies (including pdoc)
- run: pip install uv
# ADJUST THIS: build your documentation into docs/.
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
- run: uv run --extra doc pdoc --output docs --mermaid aact

- uses: actions/upload-pages-artifact@v3
python-version: 3.12
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install uv
- run: uv run mike gh-deploy --force

0 comments on commit 8467bdc

Please sign in to comment.