支持GitHub Actions

This commit is contained in:
puke
2025-11-03 17:48:08 +08:00
parent ec395196cd
commit b475090880
3 changed files with 55 additions and 0 deletions

45
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Deploy Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for git-revision-date-localized plugin
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-docs.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-docs.txt
- name: Build and deploy documentation
run: mkdocs gh-deploy --force

3
.gitignore vendored
View File

@@ -63,6 +63,9 @@ temp/
tmp/
.cache/
# MkDocs build output
site/
data
output

7
requirements-docs.txt Normal file
View File

@@ -0,0 +1,7 @@
# Documentation build dependencies
# Install with: pip install -r requirements-docs.txt
mkdocs-material>=9.6.0
mkdocs-git-revision-date-localized-plugin>=1.5.0
mkdocs-static-i18n>=1.2.0