-
Notifications
You must be signed in to change notification settings - Fork 18
65 lines (56 loc) · 1.72 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
60
61
62
63
64
65
name: Build and Serve Crate Docs
on:
push:
branches: [main]
tags:
- v*.*.*
pull_request:
branches: [main]
paths:
- ".github/workflows/docs.yml"
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
jobs:
docs:
permissions:
contents: write
packages: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
runs-on:
- runs-on=${{ github.run_id }}
- runner=8cpu-linux-arm64
steps:
- uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@nightly
# TEMPORARY
- name: Give GitHub Actions access to private repositories
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GH_ACTIONS_DEPLOY_PRIVATE_KEY }}
- name: Cargo check
run: cargo check
- name: Build documentation
run: cargo doc --workspace
# We only want the index page to display workspace crates, so we build
# separately and copy over the index as a hack
- name: Build index page
run: |
cargo doc --workspace --no-deps --exclude "openvm-benchmarks" --target-dir target/doc-nodeps
cp target/doc-nodeps/doc/index.html target/doc/
cp target/doc-nodeps/doc/crates.js target/doc/
env:
RUSTDOCFLAGS: --enable-index-page -Zunstable-options
- name: Install s5cmd
run: |
source ci/scripts/utils.sh
install_s5cmd
# TODO: store versioned copy of docs when new v*.*.* tag is pushed
- name: Sync static S3 bucket
env:
S3_BUCKET: ${{ vars.CRATE_DOCS_S3_BUCKET }}
run: |
cd target/doc
s5cmd sync . s3://${S3_BUCKET%/}/static/