Files
openmlsys-zh/.github/workflows/update_docs.yml
anyin233 00db02dbfd fix: fix equation rendering by changing the toolchain to mathjax (#493)
* docs: update README and build guide

* fix: escape * and _ inside math to prevent markdown emphasis corruption

* fix: configure MathJax to use TeX (Computer Modern) font

* feat: enhance markdown processing with label and figure collection

* fix: remove duplicate bibliography directives from chapter summaries

References are already handled at the chapter level, so the
:bibliography: directives in summary pages are redundant and cause
rendering issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 06:21:56 +00:00

61 lines
1.8 KiB
YAML

name: Deploy Docs
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'
- name: Run mdBook regression tests
run: |
python3 -m unittest discover -s tests -p 'test_prepare_mdbook.py'
python3 -m unittest discover -s tests -p 'test_prepare_mdbook_zh.py'
python3 -m unittest discover -s tests -p 'test_assemble_docs_publish_tree.py'
python3 -m unittest discover -s tests -p 'test_ensure_book_resources.py'
- name: Build English HTML with mdBook
run: bash build_mdbook.sh
- name: Build Chinese HTML with mdBook
run: bash build_mdbook_zh.sh
- name: Deploy to openmlsys.github.io
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
git clone https://x-access-token:${DEPLOY_TOKEN}@github.com/openmlsys/openmlsys.github.io.git
python3 tools/assemble_docs_publish_tree.py \
--destination-root openmlsys.github.io \
--docs-subdir docs \
--en-source .mdbook/book \
--zh-source .mdbook-zh/book
cd openmlsys.github.io
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "deploy: update docs from ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
git push
fi