-
Notifications
You must be signed in to change notification settings - Fork 85
59 lines (53 loc) · 1.66 KB
/
docs.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
name: Rustdoc
on:
push:
branches: [main]
pull_request:
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
env:
RUST_TOOLCHAIN: "nightly-2023-10-26"
RUSTDOCFLAGS: "-D warnings"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prep build on Ubuntu
if: ${{ matrix.os }} == 'ubuntu-latest'
run: |
echo "Pre cleanup"
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Post cleanup"
df -h
sudo apt-get install protobuf-compiler
- name: Install latest nightly
uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
- name: Build Documentation
id: build_docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps
- name: Build Documentation failed
if: always() && steps.build_docs.outcome == 'failure'
run: echo ":::error::cargo doc --all --no-deps failed"
# Job will stop here and the check will be red if Build documentation failed
- name: Create Index file
if: github.ref == 'refs/heads/main'
run: ./ci/create_index_for_rust_docs.sh
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
cname: reference.centrifuge.io
force_orphan: true