Skip to content

Commit 33e3fe1

Browse files
ci: Use uv rather than a Dockerfile for mkdocs
1 parent 1a9ea59 commit 33e3fe1

File tree

12 files changed

+803
-144
lines changed

12 files changed

+803
-144
lines changed
Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<% extends 'steps' %>
2+
<% block additional_permissions %>
3+
contents: write
4+
<% endblock %>
25
<% block inner_steps %>
36
- name: Install Rust stable toolchain
47
uses: actions-rust-lang/[email protected]
@@ -9,28 +12,22 @@
912
run: |
1013
mkdir -p docs/api_reference
1114
cp -r target/doc/* docs/api_reference
12-
- name: Set up QEMU
13-
uses: docker/setup-qemu-action@v3
14-
- name: Set up Docker Buildx
15-
uses: docker/setup-buildx-action@v3
16-
- name: Build and export to Docker
17-
uses: docker/build-push-action@v5
18-
with:
19-
context: docs/
20-
load: true
21-
tags: pavex-docs
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
17+
- name: Install the project
18+
run: uv sync --locked
2219
- name: Build docs
2320
run: |
24-
docker run --rm -v ${PWD}:/docs pavex-docs build --strict
25-
- uses: actions/upload-artifact@v4
21+
uv run mkdocs build --strict
22+
- uses: actions/upload-artifact@v5
2623
with:
2724
name: docs
2825
path: site/
2926
- name: Fix base
3027
run: |
3128
# Convert all "absolute" guide links in the reference to relative links so that we can scan for dead links
32-
sudo find . -type f -exec sed -i "s#https://pavex.dev/docs/#file:///${PWD}/site/#g" {} +
33-
sudo find . -type f -exec sed -i "s#https://pavex.dev/#file:///${PWD}/site/#g" {} +
29+
sudo find ./site -type f -exec sed -i "s#https://pavex.dev/docs/#file:///${PWD}/site/#g" {} +
30+
sudo find ./site -type f -exec sed -i "s#https://pavex.dev/#file:///${PWD}/site/#g" {} +
3431
- name: Link Checker
3532
uses: lycheeverse/lychee-action@v2
3633
with:
@@ -45,6 +42,7 @@
4542
--exclude-path="site/api_reference/pavex/time"
4643
--exclude-path="site/api_reference/help.html"
4744
--exclude-path="site/api_reference/settings.html"
45+
--exclude-path="site/404.html"
4846
--exclude=".*crate#per-style$"
4947
--exclude="https://doc.rust-lang.org/*"
5048
--exclude="https://stackoverflow.com/*"
@@ -55,4 +53,13 @@
5553
--require-https
5654
--no-progress
5755
site
56+
- name: Update unstable documentation
57+
# if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.event.repository.full_name == github.repository)
58+
run: |
59+
# We made some destructive updates to perform link checking,
60+
# so best to regenerate the site
61+
rm -rf site
62+
git config --global user.name "GitHub Actions"
63+
git config --global user.email "[email protected]"
64+
uv run mike deploy --push --allow-empty unstable
5865
<%- endblock %>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
permissions:
2-
pull-requests: write
3-
checks: write
41
# Run if it's a PR on the official repo or a push to `main`
52
if: |
63
(github.event_name == 'repository_dispatch' &&
@@ -10,3 +7,6 @@ if: |
107
github.event.client_payload.slash_command.args.named.sha
118
)) ||
129
(github.event_name == 'push' && github.event.repository.full_name == github.repository)
10+
permissions:
11+
pull-requests: write
12+
checks: write

.github/ci_generator/templates/steps.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<% set output %>
22
<% include 'permissions' %>
3+
<%- block additional_permissions %>
4+
<% endblock %>
35
steps:
46
- name: Checkout repository from source repo
57
if: |

0 commit comments

Comments
 (0)