-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
51 lines (45 loc) · 1.29 KB
/
action.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
name: honkit-build-page
description: A composite action for building your book website pages using Honkit
branding:
icon: "grid"
color: "green"
inputs:
nodejs-version:
description: Node.js version required for building pages
default: "20"
required: true
output-sitedir:
description: Final directory where the book site is stored
default: "_site"
required: false
working-directory:
description: "The working directory for this action"
required: false
runs:
using: composite
steps:
- name: Init Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs-version }}
- name: Install dependencies
working-directory: ${{ inputs.working-directory }}
shell: bash
run: npm install
- name: Build pages
working-directory: ${{ inputs.working-directory }}
shell: bash
run: npx honkit build
- name: Check output
working-directory: ${{ inputs.working-directory }}
shell: bash
run: |
if [ ! -d "_book" ]; then
echo "Book site doesn't exist."
exit 1
fi
- name: Move _book
if: ${{ inputs.output-sitedir != '' }}
working-directory: ${{ inputs.working-directory }}
shell: bash
run: cp -rf _book ${{ inputs.output-sitedir }}