13
13
runs-on : ubuntu-24.04
14
14
steps :
15
15
- uses : actions/checkout@v4
16
- - uses : actions-rs/ toolchain@v1
16
+ - uses : dtolnay/rust- toolchain@stable
17
17
with :
18
- profile : minimal
19
- toolchain : stable
20
- target : thumbv7em-none-eabihf
18
+ targets : thumbv7em-none-eabihf
21
19
- name : Build book code
22
20
working-directory : .
23
21
run : cargo build
27
25
runs-on : ubuntu-24.04
28
26
steps :
29
27
- uses : actions/checkout@v4
30
- - uses : actions-rs/ toolchain@v1
28
+ - uses : dtolnay/rust- toolchain@stable
31
29
with :
32
- profile : minimal
33
- toolchain : stable
34
- target : thumbv7em-none-eabihf
30
+ targets : thumbv7em-none-eabihf
35
31
- name : Build docs for micro:bit v2
36
32
working-directory : .
37
33
run : cargo doc
41
37
runs-on : ubuntu-24.04
42
38
steps :
43
39
- uses : actions/checkout@v4
44
- - uses : actions-rs/ toolchain@v1
40
+ - uses : dtolnay/rust- toolchain@stable
45
41
with :
46
- profile : minimal
47
- toolchain : stable
48
- target : thumbv7em-none-eabihf
42
+ targets : thumbv7em-none-eabihf
49
43
50
44
- name : Install Python dependencies
51
45
run : |
@@ -62,36 +56,32 @@ jobs:
62
56
restore-keys : |
63
57
${{ runner.os }}-cargo-
64
58
59
+ - name : Put mdbook-epub where mdbook expects it
60
+ if : steps.cache-cargo.outputs.cache-hit == 'true'
61
+ run : |
62
+ ls ~/cargo-bin
63
+ mkdir -p ~/.cargo/bin
64
+ cp ~/cargo-bin/mdbook-epub ~/.cargo/bin
65
+
65
66
- name : Install mdbook
66
67
if : steps.cache-cargo.outputs.cache-hit != 'true'
67
- uses :
actions-rs/[email protected]
68
- with :
69
- crate : mdbook
70
- version : 0.4.51
68
+ run : cargo install --locked mdbook --version 0.4.51
71
69
72
70
- name : Install mdbook-epub
73
71
if : steps.cache-cargo.outputs.cache-hit != 'true'
74
72
run : cargo install --locked mdbook-epub --version 0.4.48
75
73
76
- - name : Copy mdbook-epub to cache directory
77
- if : steps.cache-cargo.outputs.cache-hit != 'true'
78
- run : |
79
- mkdir -p ~/cargo-bin
80
- cp ~/.cargo/bin/mdbook-epub ~/cargo-bin
81
-
82
- - name : Copy mdbook to cache directory
74
+ - name : Copy mdbook and mdbook-epub to cache directory
83
75
if : steps.cache-cargo.outputs.cache-hit != 'true'
84
76
run : |
85
- mkdir -p ~/cargo-bin
77
+ mkdir ~/cargo-bin
86
78
cp ~/.cargo/bin/mdbook ~/cargo-bin
79
+ cp ~/.cargo/bin/mdbook-epub ~/cargo-bin
80
+ ls ~/cargo-bin
87
81
88
82
- name : Put new cargo binary directory into path
89
83
run : echo "~/cargo-bin" >> $GITHUB_PATH
90
84
91
- - name : Build EPUB
92
- working-directory : mdbook
93
- run : mdbook-epub -s
94
-
95
85
- name : Build book
96
86
working-directory : mdbook
97
87
run : mdbook build
106
96
107
97
- name : Deploy book
108
98
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
109
- uses : peaceiris/actions-gh-pages@v3
99
+ uses : peaceiris/actions-gh-pages@v4
110
100
with :
111
101
github_token : ${{ secrets.GITHUB_TOKEN }}
112
102
publish_dir : mdbook/book/html
0 commit comments