1- name : Deploy mdBook
1+ name : Deploy
22
33on :
44 push :
55 branches : [main]
66 pull_request :
77 branches : [main]
8+ workflow_dispatch :
89
9- jobs :
10- test :
11- name : Test build
12- runs-on : ubuntu-latest
13- steps :
14- - uses : actions/checkout@v5
15-
16- - name : Setup Rust
17- uses : actions-rust-lang/setup-rust-toolchain@v1
10+ permissions :
11+ contents : read
12+ pages : write
13+ id-token : write
1814
19- - name : Install mdBook and plugins
20- run : |
21- cargo install mdbook
22- cargo install mdbook-admonish
23- cargo install mdbook-mermaid
24- cargo install mdbook-linkcheck
15+ concurrency :
16+ group : " pages-${{ github.ref }}"
17+ cancel-in-progress : false
2518
26- - name : Build and test book
27- run : |
28- mdbook build
29- mdbook test
30-
31- deploy :
32- name : Deploy to GitHub Pages
19+ jobs :
20+ build :
3321 runs-on : ubuntu-latest
34- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
35- permissions :
36- contents : write
37- concurrency :
38- group : ${{ github.workflow }}-${{ github.ref }}
3922 steps :
40- - uses : actions/checkout@v5
23+ - name : Repository clone
24+ uses : actions/checkout@v5
4125 with :
4226 fetch-depth : 0
27+ submodules : recursive
4328
44- - name : Setup Rust
29+ - name : Install Rust
4530 uses : actions-rust-lang/setup-rust-toolchain@v1
31+ with :
32+ toolchain : stable
33+ components : rustfmt, clippy
4634
47- - name : Install mdBook and plugins
35+ - name : Setup mdBook and plugins
4836 run : |
4937 cargo install mdbook
5038 cargo install mdbook-admonish
5139 cargo install mdbook-mermaid
5240 cargo install mdbook-linkcheck
5341
54- - name : Build book
42+ - name : mdBook Build
5543 run : mdbook build
5644
57- - name : Setup Pages
58- uses : actions/configure-pages@v5
59-
60- - name : Upload artifact
45+ - name : Upload artifacts
6146 uses : actions/upload-pages-artifact@v4
6247 with :
6348 path : ./book
6449
65- - name : Deploy to GitHub Pages
50+ deploy :
51+ environment :
52+ name : github-pages
53+ url : ${{ steps.deployment.outputs.page_url }}
54+
55+ runs-on : ubuntu-latest
56+ needs : build
57+ if : github.ref == 'refs/heads/main'
58+
59+ steps :
60+ - name : Deploy on GitHub Pages
6661 id : deployment
6762 uses : actions/deploy-pages@v4
0 commit comments