Merge pull request #14 from kingsoftcloud/release/public-0.6.6 #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Public Docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - "mkdocs.yml" | |
| - "public-docs/**" | |
| - ".github/workflows/pages.yml" | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Build docs | |
| run: uv run --extra dev python -m mkdocs build --strict | |
| - name: Preserve legacy Chinese docs path | |
| run: | | |
| mkdir -p /tmp/ksadk-docs-zh-alias | |
| rsync -a --delete --exclude en/ --exclude zh/ site/ /tmp/ksadk-docs-zh-alias/ | |
| rm -rf site/zh | |
| mv /tmp/ksadk-docs-zh-alias site/zh | |
| - name: Audit docs artifact | |
| run: find site -type f | sed 's#^site/##' | uv run --extra dev python scripts/open_source_audit.py --target github-pages --file-list - | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |