-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (72 loc) · 2.3 KB
/
docs.yml
File metadata and controls
79 lines (72 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Docs
on:
push:
branches: [main]
paths: [book/**, README.md, "crates/*/README.md", ".github/lychee.toml", ".github/workflows/docs.yml"]
pull_request:
paths: [book/**, README.md, "crates/*/README.md", ".github/lychee.toml", ".github/workflows/docs.yml"]
schedule:
- cron: "0 6 * * 1" # every Monday 06:00 UTC
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install mdBook
run: |
mkdir -p $HOME/.local/bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.5.2/mdbook-v0.5.2-x86_64-unknown-linux-gnu.tar.gz \
| tar xz -C $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build
run: mdbook build book
- uses: actions/configure-pages@v5
if: github.ref == 'refs/heads/main'
- uses: actions/upload-pages-artifact@v4
if: github.ref == 'refs/heads/main'
with:
path: book/book
link-check:
name: Check links (lychee)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
with:
args: "--config .github/lychee.toml README.md crates/*/README.md book/src/**/*.md --offline --no-progress"
fail: true
link-check-external:
name: Check external links (lychee)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
with:
args: >-
--config .github/lychee.toml
--cache
--max-retries 3
--retry-wait-time 5
README.md crates/*/README.md book/src/**/*.md
fail: true
deploy:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4