|
1 | 1 | <% extends 'steps' %> |
| 2 | +<% block additional_permissions %> |
| 3 | + contents: write |
| 4 | +<% endblock %> |
2 | 5 | <% block inner_steps %> |
3 | 6 | - name: Install Rust stable toolchain |
4 | 7 | uses: actions-rust-lang/ [email protected] |
|
9 | 12 | run: | |
10 | 13 | mkdir -p docs/api_reference |
11 | 14 | 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 |
22 | 19 | - name: Build docs |
23 | 20 | 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 |
26 | 23 | with: |
27 | 24 | name: docs |
28 | 25 | path: site/ |
29 | 26 | - name: Fix base |
30 | 27 | run: | |
31 | 28 | # 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" {} + |
34 | 31 | - name: Link Checker |
35 | 32 | uses: lycheeverse/lychee-action@v2 |
36 | 33 | with: |
|
45 | 42 | --exclude-path="site/api_reference/pavex/time" |
46 | 43 | --exclude-path="site/api_reference/help.html" |
47 | 44 | --exclude-path="site/api_reference/settings.html" |
| 45 | + --exclude-path="site/404.html" |
48 | 46 | --exclude=".*crate#per-style$" |
49 | 47 | --exclude="https://doc.rust-lang.org/*" |
50 | 48 | --exclude="https://stackoverflow.com/*" |
|
55 | 53 | --require-https |
56 | 54 | --no-progress |
57 | 55 | 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 |
58 | 65 | <%- endblock %> |
0 commit comments