支持GitHub Actions
This commit is contained in:
45
.github/workflows/docs.yml
vendored
Normal file
45
.github/workflows/docs.yml
vendored
Normal 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
3
.gitignore
vendored
@@ -63,6 +63,9 @@ temp/
|
|||||||
tmp/
|
tmp/
|
||||||
.cache/
|
.cache/
|
||||||
|
|
||||||
|
# MkDocs build output
|
||||||
|
site/
|
||||||
|
|
||||||
data
|
data
|
||||||
output
|
output
|
||||||
|
|
||||||
|
|||||||
7
requirements-docs.txt
Normal file
7
requirements-docs.txt
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user