mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 22:07:46 +08:00
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: Deploy Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- docs/format_optimization
|
|
- Document
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: gh-pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r docs/en/requirements.txt -r docs/zh/requirements.txt jieba
|
|
|
|
- name: Build multilingual HTML
|
|
run: |
|
|
# Build English
|
|
sphinx-build -b html docs/en docs/en/_build/html
|
|
# Build Chinese
|
|
sphinx-build -b html docs/zh docs/zh/_build/html
|
|
# Merge outputs to unified publish directory
|
|
mkdir -p site/en site/zh
|
|
cp -r docs/en/_build/html/. site/en/
|
|
cp -r docs/zh/_build/html/. site/zh/
|
|
# Root redirect to English (可根据需要改成 zh)
|
|
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=en/index.html"></head><body>Redirecting...</body></html>' > site/index.html
|
|
touch site/.nojekyll
|
|
|
|
- name: Deploy to gh-pages branch
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_branch: gh-pages
|
|
publish_dir: site
|