name: Docs # push main 时构建文档站并部署到 GitHub Pages # 首次启用需在仓库 Settings → Pages 里把 Source 设为 "GitHub Actions" on: push: branches: - main paths: - "docs/**" - "mkdocs.yml" - "CHANGELOG.md" - "README.md" - "src/pytdxdata/**" - ".github/workflows/docs.yml" workflow_dispatch: permissions: contents: read concurrency: group: pages cancel-in-progress: false jobs: build: name: Build site runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v10.1.0 with: python-version: "3.13" - name: Install docs dependencies run: uv sync --locked --group docs - name: Check documentation drift run: uv run python scripts/check_docs.py - name: Build site (strict) run: uv run mkdocs build --strict - name: Configure Pages uses: actions/configure-pages@v6 - name: Upload site artifact uses: actions/upload-pages-artifact@v4 with: path: site deploy: name: Deploy to Pages needs: build runs-on: ubuntu-latest permissions: pages: write id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy id: deployment uses: actions/deploy-pages@v5