File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy mdBook
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ deploy :
10
+ runs-on : ubuntu-latest
11
+ container : mcr.microsoft.com/devcontainers/rust
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Install Node.js
17
+ run : |
18
+ apt-get update
19
+ apt-get install -y nodejs npm
20
+ node -v
21
+ npm -v
22
+
23
+ - name : Cache cargo registry
24
+ uses : actions/cache@v3
25
+ with :
26
+ path : ~/.cargo/registry
27
+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
28
+ restore-keys : |
29
+ ${{ runner.os }}-cargo-registry-
30
+
31
+ - name : Cache cargo index
32
+ uses : actions/cache@v3
33
+ with :
34
+ path : ~/.cargo/git
35
+ key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
36
+ restore-keys : |
37
+ ${{ runner.os }}-cargo-index-
38
+
39
+ - name : Cache npm
40
+ uses : actions/cache@v3
41
+ with :
42
+ path : ~/.npm
43
+ key : ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
44
+ restore-keys : |
45
+ ${{ runner.os }}-npm-
46
+
47
+ - name : Install mdBook
48
+ run : cargo install mdbook
49
+
50
+ - name : Build mdBook
51
+ run : mdbook build
52
+
53
+ - name : Set up GitHub token
54
+ run : echo "::set-env name=GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}"
55
+
56
+ - name : Deploy to GitHub Pages
57
+ uses : peaceiris/actions-gh-pages@v3
58
+ with :
59
+ github_token : ${{ secrets.GITHUB_TOKEN }}
60
+ publish_dir : ./book
61
+ publish_branch : gh-pages
62
+ user_name : ' github-actions[bot]'
63
+ user_email : ' 41898282+github-actions[bot]@users.noreply.github.com'
You can’t perform that action at this time.
0 commit comments