Tidy github workflows #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: Build docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| docs: | |
| strategy: | |
| matrix: | |
| python-version: [ 3.11 ] | |
| os: [ ubuntu-latest ] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --extra docs | |
| - name: Debug phydrax import traceback | |
| run: | | |
| uv run python - <<'PY' | |
| import traceback | |
| try: | |
| import phydrax | |
| print("phydrax import OK") | |
| except Exception: | |
| traceback.print_exc() | |
| raise | |
| PY | |
| - name: Build docs | |
| run: uv run mkdocs build | |
| - name: Deploy docs | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: uv run mkdocs gh-deploy |