Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions: update link checker and docs build workflows #398

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
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
20 changes: 10 additions & 10 deletions .github/workflows/build_and_publish_docs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and publish docs
name: Documentation - Build and publish

on:
# required to enable manual triggers on the GH web ui
workflow_dispatch:
workflow_run:
workflows:
- Link checker
- Documentation - Link checker
types:
- completed

Expand All @@ -29,17 +29,17 @@ jobs:
id: filter
with:
filters: |
changes:
docs_changes:
- 'docs/**'

- name: Set up Python 3.11
if: steps.filter.outputs.changes == 'true'
if: steps.filter.outputs.docs_changes == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Set up environment
if: steps.filter.outputs.changes == 'true'
if: steps.filter.outputs.docs_changes == 'true'
id: setup
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
Expand All @@ -48,32 +48,32 @@ jobs:
continue-on-error: false

- name: Install docs dependencies
if: steps.filter.outputs.changes == 'true'
if: steps.filter.outputs.docs_changes == 'true'
id: install_build_dependencies
run: |
. .venv/bin/activate
uv pip install -r pyproject.toml --extra docs
continue-on-error: false

- name: Build documentation
if: steps.filter.outputs.changes == 'true'
if: steps.filter.outputs.docs_changes == 'true'
run: |
. .venv/bin/activate
cd docs
sphinx-build source build/html

- name: Set up pages
if: steps.filter.outputs.changes == 'true'
if: steps.filter.outputs.docs_changes == 'true'
uses: actions/configure-pages@v4

- name: Upload artifact
if: steps.filter.outputs.changes == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: steps.filter.outputs.docs_changes == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html/

- name: Deploy
if: steps.filter.outputs.changes == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: steps.filter.outputs.docs_changes == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/deploy-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/check_links.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Link checker
name: Documentation - Link checker

on:
push:
Expand All @@ -16,16 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check for modified paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changes:
- 'docs/**'

- name: Link Checker
if: steps.filter.outputs.changes == 'true'
- name: Check links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
Expand Down