Skip to content

Commit

Permalink
GitHub actions: update link checker and docs build workflows (#398)
Browse files Browse the repository at this point in the history
* Always run link checker

* Update workflow names, use more specific var for docs changes.
  • Loading branch information
peteski22 authored Nov 19, 2024
1 parent ca66bd8 commit 9b8a9b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
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

0 comments on commit 9b8a9b3

Please sign in to comment.