-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (53 loc) · 1.49 KB
/
deploy.yml
File metadata and controls
62 lines (53 loc) · 1.49 KB
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
on:
push:
branches:
- code
pull_request:
branches:
- code
name: Build, test, deploy
jobs:
build_test_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Checks
run: ./checks.sh
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Install mdBook
run: |
wget 'https://github.com/rust-lang/mdBook/releases/download/v0.4.3/mdbook-v0.4.3-x86_64-unknown-linux-gnu.tar.gz' --output-document 'mdbook.tar.gz'
tar -zxvf mdbook.tar.gz
ls
- name: Cache Cargo Registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Cargo Build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build Crate
uses: actions-rs/cargo@v1
with:
command: build
- name: Build Book
run: ./mdbook build
- name: Test Examples
uses: actions-rs/cargo@v1
with:
command: test
- name: Deploy
uses: maxheld83/ghpages@v0.2.1
if: github.ref == 'refs/heads/code'
env:
BUILD_DIR: book
GH_PAT: ${{ secrets.TOKEN }}