-
Notifications
You must be signed in to change notification settings - Fork 30
67 lines (64 loc) · 1.92 KB
/
publish.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
66
67
name: Publish
on:
push:
branches:
- master
jobs:
publish-tutorial:
name: Publish - Tutorial
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUST_VERSION: 1.51.0
MDBOOK_VERSION: 0.4.21
steps:
# Checkout
- name: Checkout Repository
uses: actions/checkout@v2
# Dependencies
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: 14
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Cache mdbook
id: cache-mdbook
uses: actions/cache@v2
with:
path: ~/.cargo/bin/mdbook
key: ${{ runner.os }}-${{ env.RUST_VERSION }}-${{ env.MDBOOK_VERSION }}
- name: Install mdbook
uses: actions-rs/cargo@v1
if: steps.cache-mdbook.outputs.cache-hit != 'true'
with:
command: install
args: mdbook --version ${{ env.MDBOOK_VERSION }} --no-default-features
# Publish
- name: Build Index
working-directory: ./generator
run: ./gradlew run --args="--directory=.. index"
- name: Cache Preprocessor
id: cache-preprocessor
uses: actions/cache@v2
with:
path: ~/.cargo/bin/vk-preprocessor
key: ${{ hashFiles('index.txt', 'tutorial/book/preprocessor/**') }}
- name: Build Preprocessor
uses: actions-rs/cargo@v1
if: steps.cache-preprocessor.outputs.cache-hit != 'true'
with:
command: install
args: --path ./tutorial/book/preprocessor
- name: Build Tutorial
working-directory: ./tutorial/book
run: mdbook build
- name: Publish Tutorial
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: ./tutorial/book/book
CLEAN: true