update build scripts #3
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: Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Sync documentation dependencies | |
| run: uv sync --locked --only-group doc --no-install-project | |
| - name: Generate API reference stubs | |
| run: cargo run --manifest-path Cargo.toml --package v8-python --bin stub_gen | |
| - name: Build documentation | |
| run: uv run --no-sync zensical build --strict | |
| - name: Upload Pages artifact | |
| if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| name: Deploy GitHub Pages | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |