Deploy Docs #2
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: Deploy Docs | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Install dependencies | |
| run: | | |
| source $HOME/.cargo/env | |
| uv sync --all-extras | |
| - name: Build documentation (en + zh) | |
| run: | | |
| source $HOME/.cargo/env | |
| # Clean site directory to ensure fresh build | |
| rm -rf site | |
| # Build English documentation (outputs to site/) | |
| uv run mkdocs build -f mkdocs.en.yml | |
| # Build Chinese documentation (outputs to site/zh/) | |
| uv run mkdocs build -f mkdocs.zh.yml | |
| # Verify both versions were built | |
| ls -la site/ | |
| ls -la site/zh/ || echo "Warning: Chinese docs not found" | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |