Doc improvements #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: Docs | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build-docs: | |
| name: "Build Docs" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.12"] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.41.4 | |
| cache: true | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: install tinytex | |
| run: | | |
| quarto install tinytex | |
| - name: Compile docstrings with quartodoc | |
| run: | | |
| pixi run docs-build | |
| - name: Render docs | |
| run: | | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| pixi run docs-render -- --no-cache | |
| else | |
| pixi run docs-render | |
| fi | |
| - name: Save docs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-html-${{ matrix.python-version }} | |
| path: docs/_site | |
| publish-docs: | |
| name: "Publish Docs" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| needs: ["build-docs"] | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| steps: | |
| - name: Download docs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-html-3.12 | |
| path: docs/_site | |
| - name: Publish docs to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/_site | |
| preview-docs: | |
| name: "Preview Docs" | |
| runs-on: ubuntu-latest | |
| needs: ["build-docs"] | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Download docs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docs-html-3.12 | |
| path: docs/_site | |
| - name: Upload docs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-preview | |
| path: docs/_site |