Refactor build workflow to deploy documentation to GitHub Pages

This commit is contained in:
obyalian
2025-09-13 14:31:22 +08:00
parent 31f713c1bb
commit b11de24267
+29 -42
View File
@@ -1,49 +1,36 @@
name: Build
name: Deploy Docs
on:
push:
branches:
- Document
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
default: 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.12]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pybind11==2.11.0 pybind11-global==2.11.0 wheel
- name: Configure CMake
run: cmake -S . -B build -DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }}
- name: Build
run: cmake --build build --config Release
- name: Build Python Wheel
run: |
python setup.py bdist_wheel
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: python-wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/*.whl
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx recommonmark sphinx-rtd-theme sphinx-markdown-tables
- name: Build HTML
run: sphinx-build -b html docs docs/_build/html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
external_repository: orbbec/OrbbecSDK_ROS2
publish_branch: gh-pages
publish_dir: docs/_build/html