-
Notifications
You must be signed in to change notification settings - Fork 83
38 lines (36 loc) · 1.08 KB
/
cargo-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
name: Publish Rust doc
on:
push:
branches:
- master
jobs:
publish:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install System Dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
cmake pkg-config libssl-dev git clang curl libc6-dev protobuf-compiler
- name: Set variables
run: |
echo "TOOLCHAIN=$(rustup show active-toolchain | cut -d " " -f1)" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.TOOLCHAIN }}
- name: build docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: copy index.html
run: cp .github/docs-index.html target/doc/index.html
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: target/doc/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}