39 lines
974 B
YAML
39 lines
974 B
YAML
name: Deploy MkDocs
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
# Step 1: Checkout the repository
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
# Step 2: Install uv
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
with:
|
|
activate-environment: true
|
|
python-version: "3.10"
|
|
enable-cache: true
|
|
|
|
# Step 3: Install MkDocs and dependencies
|
|
- run: uv pip install mkdocs mkdocs-material mkdocs-pagetree-plugin
|
|
|
|
# Step 4: Deploy to GitHub Pages
|
|
- run: |
|
|
mkdir -p gh-pages/docs
|
|
cp -r tutorials/* gh-pages/docs
|
|
cd gh-pages
|
|
mv docs/mkdocs.yml mkdocs.yml
|
|
echo "{{ pagetree }}" > docs/index.md
|
|
mkdocs gh-deploy --force
|
|
|
|
- name: Minimize uv cache
|
|
run: uv cache prune --ci
|