Skip to content

Commit

Permalink
Fixes publish plubish-docs build (pygraphviz build failure) (#58)
Browse files Browse the repository at this point in the history
One needs to install graphviz over the system package manager before
installing pygraphviz to prevent an automatic build that fails. This can
is achieved with `sudo apt-get install graphviz graphviz-dev`.

The `--force` was in `hatch run docs:deploy --force` was ignored. hatch
does not support arguments so we directly use it in the hatch-script
definition. Replacing `--force` to ``--no-history`.`
See pypa/hatch#988

We also add the `workflow_dispatch` event so we can run the workflow
manually.
  • Loading branch information
agoscinski authored Dec 3, 2024
1 parent 4d4e501 commit 602c3fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.12']

steps:

- uses: actions/checkout@v4
Expand All @@ -18,13 +24,21 @@ jobs:
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: ${{ matrix.python-version }}

- name: Install hatch
run: |
pip install --upgrade pip
pip install hatch
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Install Graphviz
run: sudo apt-get install graphviz graphviz-dev

# caches the build docs
# see https://squidfunk.github.io/mkdocs-material/plugins/requirements/caching/
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
Expand All @@ -34,5 +48,4 @@ jobs:
- name: "Build and deploy docs to gh-pages"
run: |
pip install hatch
hatch run docs:deploy --force
hatch run docs:deploy
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ serve = [
]

deploy = [
"mkdocs gh-deploy -f docs/mkdocs.yml"
"mkdocs gh-deploy --no-history -f docs/mkdocs.yml"
]

0 comments on commit 602c3fe

Please sign in to comment.