forked from crystal-lang/crystal-book
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.56 KB
/
build-and-deploy.yaml
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
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10'
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install -g [email protected]
- run: npm install
- run: gitbook install --gitbook=3.2.2
- run: gitbook build --gitbook=3.2.2
- name: Record git revision
run: echo "${GITHUB_SHA}" > _book/.rev
- name: Upload HTML GitBook
uses: actions/upload-artifact@v1
with:
name: book
path: _book
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Download HTML GitBook
uses: actions/download-artifact@v1
with:
name: book
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
force_orphan: false
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'