Skip to content

Commit 585a425

Browse files
authored
ci: build the docs without Docker (#2742)
Install the hash-pinned docs requirements with setup-python and run mkdocs build directly, instead of building on top of the squidfunk/mkdocs-material image. Add mkdocs-material to docs/requirements.in, pinned to the version the image currently ships, so the requirements file describes the whole build. docs/Dockerfile stays for local previews. Fixes #2741
1 parent db3db31 commit 585a425

4 files changed

Lines changed: 253 additions & 7 deletions

File tree

‎.github/workflows/build-docs.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@ jobs:
3737
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
3838
with:
3939
fetch-depth: 0
40+
- name: Set up Python
41+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
42+
with:
43+
python-version: "3.12"
44+
cache: pip
45+
cache-dependency-path: docs/requirements.txt
4046
- name: Build
4147
run: |
42-
mkdir -p dist
43-
docker build -t squidfunk/mkdocs-material ./docs/
44-
docker run --rm -t -v ${PWD}:/docs squidfunk/mkdocs-material build
48+
pip install --require-hashes -r docs/requirements.txt
49+
mkdocs build
4550
- name: Configure AWS credentials
4651
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd
4752
with:

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,16 @@ jobs:
281281
with:
282282
# Checkout PR branch to make sure we build the version-bumped docs
283283
ref: ci-${{ github.run_id }}
284+
- name: Set up Python
285+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
286+
with:
287+
python-version: "3.12"
288+
cache: pip
289+
cache-dependency-path: docs/requirements.txt
284290
- name: Build
285291
run: |
286-
mkdir -p dist
287-
docker build -t squidfunk/mkdocs-material ./docs/
288-
docker run --rm -t -v ${PWD}:/docs squidfunk/mkdocs-material build
292+
pip install --require-hashes -r docs/requirements.txt
293+
mkdocs build
289294
- name: Configure AWS credentials
290295
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd
291296
with:

‎docs/requirements.in‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs-git-revision-date-plugin==0.3.2
22
mkdocs-macros-plugin==1.3.7
33
mkdocs-llmstxt==0.2.0
4+
mkdocs-material==9.8.0

0 commit comments

Comments
 (0)