-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
111 lines (98 loc) · 4.35 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Documentation GH-Pages Action
description: Generate the code, asyncapi and openapi documentation and push it on Github Pages.
inputs:
should-generate-code-documentation:
description: 'True if you want to generate the code documentation, false otherwise.'
default: 'false'
required: false
code-documentation-generation-command:
description: 'The command to generate code documentation.'
default: './gradlew dokkaHtml'
required: false
code-documentation-dst-folder:
description: 'The destination folder of the generated code documentation.'
default: './build/dokka/html'
required: false
code-documentation-site-folder:
description: 'The site folder of the generated code documentation.'
default: 'documentation/code-doc/'
required: false
should-generate-openapi-documentation:
description: 'True if you want to generate the open api documentation, false otherwise.'
default: 'false'
required: false
openapi-documentation-input-file:
description: 'The input file with rest api specification in open api standard.'
default: 'docs/openapi/openapi.yml'
required: false
openapi-documentation-dst-folder:
description: 'The destination folder of the generated open api documentation.'
default: 'documentation/openapi-doc'
required: false
should-generate-asyncapi-documentation:
description: 'True if you want to generate the async api documentation, false otherwise.'
default: 'false'
required: false
asyncapi-documentation-input-file:
description: 'The input file with async api specification in latest async api standard.'
default: 'docs/asyncapi/asyncapi.yml'
required: false
asyncapi-documentation-dst-folder:
description: 'The destination folder of the generated async api documentation.'
default: 'documentation/asyncapi-doc'
required: false
github-token:
description: 'The GitHub token, it will be used to push the documentation on gh-pages branch'
required: true
runs:
using: composite
steps:
- name: Generate AsyncAPI Documentation
if: inputs.should-generate-asyncapi-documentation == 'true'
shell: bash
run: |
npm install -g @asyncapi/[email protected]
ag ${{ inputs.asyncapi-documentation-input-file }} @asyncapi/html-template -o ${{ inputs.asyncapi-documentation-dst-folder }}
- name: Generate Code Documentation
shell: bash
if: inputs.should-generate-code-documentation == 'true'
run: ${{ inputs.code-documentation-generation-command }}
- name: Generate Swagger OpenAPI Documentation
if: inputs.should-generate-openapi-documentation == 'true'
uses: Legion2/swagger-ui-action@v1
with:
output: ${{ inputs.openapi-documentation-dst-folder }}
spec-file: ${{ inputs.openapi-documentation-input-file }}
- name: Deploy code documentation on Github Pages
if: inputs.should-generate-code-documentation == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.github-token }}
keep_files: true
publish_dir: ${{ inputs.code-documentation-dst-folder }}
destination_dir: ${{ inputs.code-documentation-site-folder }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'docs: update code documentation'
- name: Deploy OpenAPI documentation on Github Pages
if: inputs.should-generate-openapi-documentation == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.github-token }}
keep_files: true
publish_dir: ${{ inputs.openapi-documentation-dst-folder }}
destination_dir: ${{ inputs.openapi-documentation-dst-folder }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'docs: update openapi documentation'
- name: Deploy AsyncAPI documentation on Github Pages
if: inputs.should-generate-asyncapi-documentation == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.github-token }}
keep_files: true
publish_dir: ${{ inputs.asyncapi-documentation-dst-folder }}
destination_dir: ${{ inputs.asyncapi-documentation-dst-folder }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'docs: update asyncapi documentation'