-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (74 loc) · 2.14 KB
/
docs.yml
File metadata and controls
81 lines (74 loc) · 2.14 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
80
81
name: docs
# mdbook to GitHub Pages + rustdoc warnings gate.
on:
push:
branches: [main]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
- "crates/**/src/**"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
paths:
- "docs/**"
- ".github/workflows/docs.yml"
- "crates/**/src/**"
- "Cargo.toml"
- "Cargo.lock"
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
jobs:
rustdoc:
name: rustdoc 0-warnings gate
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo doc (deny warnings)
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --workspace
build:
name: build mdbook
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install mdbook
run: |
set -euo pipefail
MDBOOK_VERSION="0.5.2"
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar xz -C /usr/local/bin
- name: Build
run: mdbook build docs/
- name: Write CNAME (if Agent-git_DOCS_DOMAIN set)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.Agent-git_DOCS_DOMAIN != ''
run: echo "${{ vars.Agent-git_DOCS_DOMAIN }}" > docs/book/CNAME
- name: Upload Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/book
deploy:
name: deploy
needs: [build, rustdoc]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4