-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
97 lines (77 loc) · 2.66 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: 'Build Docs'
inputs:
asdf-system:
description: 'ASDF system to build system for'
required: true
qlfile-template:
description: "Djula template for qlfile. All environment variables are available in it's context"
required: false
error-on-warnings:
description: 'If documentation will generate any warnings, build will fail.'
required: false
default: true
ngrok-auth-token:
description: "A token to debug processes."
required: false
runs:
using: composite
steps:
- name: Install Documentation Builder
shell: bash
run: |
echo ::group::Install Documentation Builder
set -Eeuo pipefail
if [ -n "${RUNNER_DEBUG:-}" ]; then
echo "Environment:"
env | sort -u
echo "Current directory is $(pwd):"
ls -l
echo "Qlfile's content before modification:"
echo "====================================="
cat qlfile
echo "====================================="
fi
# qlfile might not have a new-line at the end
# thus we have to add one just to be sure.
echo '' >> qlfile
if ! grep -q log4cl-extras qlfile; then
echo 'github log4cl-extras 40ants/log4cl-extras' >> qlfile
fi
if ! grep -q docs-builder qlfile; then
echo 'github docs-builder 40ants/docs-builder' >> qlfile
fi
if ! grep -q ngrok qlfile; then
echo 'github ngrok 40ants/ngrok' >> qlfile
fi
if [ -n "${RUNNER_DEBUG:-}" ]; then
echo "Qlfile's content after modification:"
echo "===================================="
cat qlfile
echo "===================================="
fi
qlot update --no-deps
qlot exec ros install docs-builder
qlot exec ros install ngrok
echo ::endgroup::
- name: Build Docs
shell: bash
run: |
set -Eeuo pipefail
echo ::group::Build Docs
qlot exec build-docs --error-on-warnings "${{ inputs.error-on-warnings }}" "${{ inputs.asdf-system }}" output.dir
echo ::endgroup::
- name: Upload Docs
shell: bash
run: |
set -Eeuo pipefail
echo ::group::Upload Docs
msg=$(git show -s --format='%s')
if [[ "$msg" == 'Update docs' ]]; then
echo "Skipping documentation upload, because previous commit was: ${msg}."
else
qlot exec ${{ github.action_path }}/upload.ros "$(cat output.dir)"
fi
echo ::endgroup::
env:
GITHUB_TOKEN: ${{ github.token }}
NGROK_AUTH_TOKEN: ${{ inputs.ngrok-auth-token }}