-
-
Notifications
You must be signed in to change notification settings - Fork 252
55 lines (46 loc) · 1.46 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
# build and deploy on master push, otherwise just try to build the page
on:
push:
branches:
- master
pull_request:
name: Build website with Zola, build rust docs and publish to GH pages
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master' && github.repository == 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Build only'
uses: shalzz/zola-deploy-action@master
env:
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}
BUILD_ONLY: true
- name: Build Documentation
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
build_and_deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.repository != 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, rust-src
- name: Build Documentation
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
- name: Copy Rust Documentation to Zola
run: cp -R "target/doc/" "docs/website/static/rustdocs/"
- name: 'Build and deploy'
uses: shalzz/zola-deploy-action@master
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}