-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
53 lines (51 loc) · 1.52 KB
/
action.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
name: Build and publish docs
description: Builds and publishes project documentation
inputs:
publish_dir:
description: The destination subdirectory on a publishing branch. Defaults to dev
required: false
default: dev
docs_dir:
description: The directory containing the documentation. Defaults to docs
required: false
default: docs
github_token:
description: The github token to use for publishing
required: false
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 0.100.1
extended: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 17.7
- name: Install mermaid
shell: bash
run: npm install -g @mermaid-js/mermaid-cli
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install asciidoctor
shell: bash
run: gem install asciidoctor asciidoctor-diagram asciidoctor-html5s rouge
- name: Install dependencies
working-directory: ${{ inputs.docs_dir }}
shell: bash
run: npm install
- name: Build documentation
working-directory: ${{ inputs.docs_dir }}
shell: bash
run: hugo --minify -d ./public
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.github_token }}
publish_dir: ${{ inputs.docs_dir }}/public
destination_dir: ${{ inputs.publish_dir }}