-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (71 loc) · 1.99 KB
/
rustdoc.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
name: rustdoc
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_INCREMENTAL: 0
jobs:
rustdoc:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: checkout all the submodules
uses: actions/[email protected]
with:
submodules: recursive
# for devtools-frontend
- uses: actions/[email protected]
with:
node-version: 21
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Rust toolchain
id: toolchain
run: |
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
- name: cache dependencies
uses: Swatinem/[email protected]
- name: Install cargo-about
run: cargo install cargo-about --locked
- name: Install wasm-pack
run: cargo install wasm-pack --locked
- run: rm -rf ./target/doc
- run: cargo doc --all --no-deps
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
- name: add index.html
run: |
cat > ./target/doc/index.html << EOS
<meta http-equiv="refresh" content="1;URL=/gaia_tmtc">
EOS
- name: Fix file permissions
shell: sh
run: |
chmod -c -R +rX "target/doc/"
- name: Archive rustdoc
uses: actions/[email protected]
with:
path: target/doc/
deploy:
if: github.ref == 'refs/heads/main'
needs: rustdoc
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]