-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (51 loc) · 1.53 KB
/
build.yaml
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
name: Build and publish docs
on:
schedule:
# once per day
- cron: "0 0 * * *"
# run manually from the GitHub Actions webpage
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: pages
- name: Checkout shadow/shadow
uses: actions/checkout@v3
with:
path: shadow
repository: shadow/shadow
- name: Upgrade cargo/rust
run: rustup update
# Run cmake to generate shd-config.h
- name: Run cmake
run: |
sudo apt-get install cmake
cmake -S shadow -B shadow/build
- name: Build rustdoc
run: cd shadow/src && cargo doc
- name: Copy rustdoc
run: |
rm -rf pages/docs
mkdir pages/docs
mv shadow/src/target/doc pages/docs/rust
echo '<meta http-equiv="refresh" content="0; url=/docs/rust/shadow_rs/">' > pages/docs/rust/index.html
- name: Build guide
run: |
cargo install --vers "^0.4" mdbook
mdbook build --dest-dir ../../pages/docs/guide shadow/mdbook
echo '<meta http-equiv="refresh" content="0; url=/docs/guide/">' > pages/docs/index.html
- name: Commit
run: |
COMMIT="$(cd shadow && git rev-parse --short HEAD)"
cd pages
git config user.name github-actions
git config user.email [email protected]
git add .
git diff-index --quiet HEAD || git commit -m "Generated docs for shadow/shadow@$COMMIT"
git push