-
Notifications
You must be signed in to change notification settings - Fork 30
78 lines (75 loc) · 2.22 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
68
69
70
71
72
73
74
75
76
77
78
name: Publish
on:
push:
branches:
- master
workflow_dispatch:
inputs:
error_debug:
type: boolean
required: false
default: false
force_debug:
type: boolean
required: false
default: false
jobs:
publish-tutorial:
name: Publish - Tutorial
runs-on: ubuntu-latest
env:
RUST_LOG: info
RUST_VERSION: 1.70.0
MDBOOK_VERSION: 0.4.21
steps:
# Checkout
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
# Dependencies
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: 21
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- 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
if: steps.cache-mdbook.outputs.cache-hit != 'true'
run: cargo install 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
if: steps.cache-preprocessor.outputs.cache-hit != 'true'
run: cargo install --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
# Debug
- name: Debug
uses: mxschmitt/action-tmate@v3
if: ${{ (failure() && inputs.error_debug) || inputs.force_debug }}