-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
54 lines (48 loc) · 1.27 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
52
53
54
name: docs-build-static-action
description: Build documentation
inputs:
src-root:
default: "./"
build-root:
default: "./_site"
runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Pages
uses: actions/configure-pages@v4
- run: npm i @diplodoc/cli -g
shell: bash
- name: Build _site
id: build-html
run: |
set +e
set -o pipefail
yfm -i ${{ inputs.src-root }} -o ${{ inputs.build-root }} | tee './build.log'
echo "exitcode=$?" >> $GITHUB_OUTPUT
shell: bash
- name: Upload build log
uses: actions/upload-artifact@v3
with:
name: build-log-html
path: ./build.log
retention-days: 1
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ inputs.build-root }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Exit
run: |
exitcode=${{ steps.build-html.outputs.exitcode }}
if [ "$exitcode" -eq 0 ]; then
echo "Build exited successfully."
else
echo "Build exited with an error. Exit code: $exitcode"
exit $exitcode
fi
shell: bash