Repository navigation
Fix release workflow (#21) #33
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 | |
| # The Astro + Starlight site in docs/: hand-written pages, the executed tutorials and the API | |
| # reference. Built on every push and pull request; deployed to GitHub Pages from devel. | |
| on: | |
| push: | |
| branches: ["main", "devel"] | |
| pull_request: | |
| branches: ["main", "devel"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: docs-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install the package with the docs extra | |
| run: | | |
| uv sync --extra docs | |
| uv run python -m ipykernel install --user --name python3 | |
| - name: Execute and convert the tutorials | |
| run: | | |
| uv run python docs/tools/notebooks.py execute | |
| uv run python docs/tools/notebooks.py convert --strict | |
| - name: Build the site | |
| working-directory: docs | |
| run: | | |
| npm ci | |
| npm run check:mdx | |
| DOCS_PYTHON="$(pwd)/../.venv/bin/python" npm run build | |
| - name: Smoke test the built site | |
| working-directory: docs | |
| run: | | |
| for page in /index.html /getting-started/installation/index.html /tutorials/example-tutorial/index.html /api/app/index.html /api/app/main/index.html; do | |
| test -f "dist$page" || { echo "missing dist$page"; exit 1; } | |
| done | |
| grep -q 'href="/template-python/' dist/index.html || { echo "links do not use the base path"; exit 1; } | |
| echo "all pages built with the /template-python base path" | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/dist | |
| deploy: | |
| needs: build | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/devel' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |