-
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (60 loc) · 2 KB
/
book.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
on:
push:
branches:
- main
pull_request:
branches:
- '**'
name: Book
jobs:
publish_book:
name: Peace Book
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@latest
- uses: dtolnay/rust-toolchain@stable
- name: 'Install `wasm-pack`'
uses: jetli/[email protected]
with:
version: 'v0.11.1'
- name: mdbook-graphviz Cache
id: mdbook_graphviz_cache
uses: actions/cache@v3
with:
path: ~/.cargo/bin/mdbook-graphviz
key: ${{ runner.os }}-mdbook-graphviz
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- run: cargo install mdbook-graphviz --git https://github.com/azriel91/mdbook-graphviz.git --branch maintenance/update-dependencies
if: steps.mdbook_graphviz_cache.outputs.cache-hit != 'true'
# When updating this, also update ci.yml
- name: 'Example: download (WASM)'
# The following no longer works, because the AWS SDK uses tokio with UDP features enabled:
# for example in $(ls examples)
run: |
for example in download
do wasm-pack build \
--target web \
--out-dir "../../doc/src/examples/pkg" \
--release \
"examples/${example}" \
--features 'error_reporting'
done
# Build and publish book
- name: Install `mdbook`
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: latest
- run: mdbook build doc
# Note: `test` doesn't work with the examples' inlined HTML.
# - run: mdbook test doc
# We *do* want to include the built wasm files.
- run: rm -f ./doc/book/examples/pkg/.gitignore
- name: Publish to `gh-pages`
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/book
force_orphan: true