File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : " build and deploy docs to github pages"
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+
7
+ pull_request :
8
+ branches : [main]
9
+
10
+ permissions :
11
+ contents : read
12
+ pages : write
13
+ id-token : write
14
+
15
+ concurrency :
16
+ group : deploy
17
+ cancel-in-progress : false
18
+
19
+ jobs :
20
+ build :
21
+ name : Build
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - name : Checkout repository
25
+ uses : actions/checkout@v4
26
+
27
+ - name : Setup Rust
28
+ uses : dtolnay/rust-toolchain@nightly
29
+ with :
30
+ targets : x86_64-unknown-none
31
+
32
+ - name : Add components
33
+ run : rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
34
+
35
+ - name : Configure cache
36
+ uses : Swatinem/rust-cache@v2
37
+
38
+ - name : Setup pages
39
+ id : pages
40
+ uses : actions/configure-pages@v5
41
+
42
+ - name : Clean docs folder
43
+ run : cargo clean --doc -Z bindeps
44
+
45
+ - name : Build docs
46
+ run : cd src/kernel && cargo doc -Zbuild-std --no-deps --document-private-items
47
+
48
+ - name : Add redirect
49
+ run : echo '<meta http-equiv="refresh" content="0;url=kernel/index.html">' > target/x86_64-unknown-none/doc/index.html
50
+
51
+ - name : Remove lock file
52
+ run : rm target/x86_64-unknown-none/doc/.lock
53
+
54
+ - name : Upload artifact
55
+ uses : actions/upload-pages-artifact@v3
56
+ with :
57
+ path : target/x86_64-unknown-none/doc
58
+
59
+ deploy :
60
+ name : Deploy
61
+ environment :
62
+ name : github-pages
63
+ url : ${{ steps.deployment.outputs.page_url }}
64
+ runs-on : ubuntu-latest
65
+ needs : build
66
+ steps :
67
+ - name : Deploy to GitHub Pages
68
+ id : deployment
69
+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments