Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
paths:
- 'docsite/**'
- '.github/workflows/docs.yaml'

permissions:
contents: read
Expand All @@ -22,6 +19,7 @@ concurrency:

jobs:
build:
name: docs
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false

runs-on: ubuntu-latest
Expand All @@ -34,23 +32,41 @@ jobs:
with:
fetch-depth: 0

# No paths: filter on the pull_request trigger (unlike push, above) so this
# job always runs and can be a required status check without permanently
# blocking merge on PRs that never touch docsite/ — see relevant-changes gate below.
- name: Check for relevant changes
id: changes
if: github.event_name == 'pull_request'
run: |
if git diff --name-only "origin/${{ github.event.pull_request.base.ref }}...HEAD" | grep -qE '^(docsite/|\.github/workflows/docs\.yaml)'; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
else
echo "relevant=false" >> "$GITHUB_OUTPUT"
fi

- name: Install pngquant
if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true'
run: sudo apt-get update && sudo apt-get install -y pngquant

- name: Setup Python
if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true'
uses: actions/setup-python@v6
with:
python-version-file: "docsite/pyproject.toml"

- name: Install uv
if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install the project
if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true'
run: uv sync --locked --all-extras --dev

- name: Build documentation
if: github.event_name != 'pull_request' || steps.changes.outputs.relevant == 'true'
run: uv run zensical build -f zensical.toml --clean

- name: Upload artifact
Expand Down