Skip to content

Commit da9daf9

Browse files
Merge pull request #51 from jeromekelleher/fix-docs-params
Replace pre-build-command with declarative install-playwright input
2 parents 00f64c1 + 20e714a commit da9daf9

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

.github/actions/build-docs/action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ inputs:
2323
required: false
2424
default: ''
2525

26-
pre-build-command:
27-
description: 'Command to run after installing deps but before the docs build'
28-
required: false
29-
default: ''
30-
3126
install-slim:
3227
description: 'Whether to install SLiM'
3328
required: false
3429
default: 'false'
3530

31+
install-playwright:
32+
description: 'Install Playwright (chromium) for docs that render browser screenshots'
33+
required: false
34+
default: 'false'
35+
3636
runs:
3737
using: composite
3838
steps:
@@ -89,12 +89,12 @@ runs:
8989
echo "PKG_VERSION=$PKG_VERSION"
9090
sed -i s/__PKG_VERSION__/${PKG_VERSION}/g docs/_config.yml
9191
92-
- name: Pre-build
93-
if: inputs.pre-build-command != ''
92+
- name: Install Playwright
93+
if: ${{ inputs.install-playwright == 'true' }}
9494
shell: bash
9595
env:
96-
PRE_BUILD_COMMAND: ${{ inputs.pre-build-command }}
97-
run: ${PRE_BUILD_COMMAND}
96+
PYPROJECT_DIRECTORY: ${{ inputs.pyproject-directory }}
97+
run: uv run --no-default-groups --project=${PYPROJECT_DIRECTORY} --locked --group=docs playwright install --with-deps chromium
9898

9999
- name: Build documentation
100100
shell: bash

.github/workflows/docs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ on:
2323
type: string
2424
default: ''
2525

26-
pre-build-command:
27-
description: 'Command to run after installing deps but before the docs build'
28-
required: false
29-
type: string
30-
default: ''
31-
3226
install-slim:
3327
description: 'Whether to install SLiM'
3428
required: false
3529
type: boolean
3630
default: false
3731

32+
install-playwright:
33+
description: 'Install Playwright (chromium) for docs that render browser screenshots'
34+
required: false
35+
type: boolean
36+
default: false
37+
3838
permissions:
3939
contents: read
4040

@@ -57,8 +57,8 @@ jobs:
5757
with:
5858
pyproject-directory: ${{ inputs.pyproject-directory }}
5959
additional-apt-packages: ${{ inputs.additional-apt-packages }}
60-
pre-build-command: ${{ inputs.pre-build-command }}
6160
install-slim: ${{ inputs.install-slim }}
61+
install-playwright: ${{ inputs.install-playwright }}
6262

6363
- name: Trigger tskit-site rebuild
6464
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)