Skip to content

Commit 4eeba69

Browse files
ci: add job to generate and deploy asyncapi documentation
1 parent 250c069 commit 4eeba69

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
context: .
107107
push: true
108108
tags: ${{ steps.full-image-name.outputs.image-name }}:latest, ${{ steps.full-image-name.outputs.image-name }}:${{ needs.release.outputs.release-version }}
109+
109110
documentation-deploy:
110111
needs:
111112
- release
@@ -129,14 +130,47 @@ jobs:
129130
destination_dir: kdoc
130131
user_name: 'github-actions[bot]'
131132
user_email: 'github-actions[bot]@users.noreply.github.com'
132-
commit_message: 'docs: update documentation'
133+
commit_message: 'docs: update project documentation'
134+
135+
async-api-deploy:
136+
needs:
137+
- release
138+
if: needs.release.outputs.release-status == 'released'
139+
steps:
140+
- name: Checkout the repository
141+
uses: actions/checkout@v3
142+
with:
143+
submodules: recursive
144+
fetch-depth: 0
145+
- name: Validating AsyncAPI document
146+
uses: WaleedAshraf/[email protected]
147+
with:
148+
filepath: docs/api/my-asyncapi.yml
149+
- name: Generating HTML from AsyncAPI document
150+
uses: docker://asyncapi/github-action-for-generator:2.0.0
151+
with:
152+
template: '@asyncapi/[email protected]'
153+
filepath: docs/async-api/async-api.yml
154+
output: ./build/asyncapi/html
155+
- name: Deploy AyncAPI documentation on GitHub Pages
156+
uses: peaceiris/actions-gh-pages@v3
157+
with:
158+
github_token: ${{ secrets.GITHUB_TOKEN }}
159+
keep_files: true
160+
publish_dir: ./build/asyncapi/html
161+
destination_dir: asyncapi
162+
user_name: 'github-actions[bot]'
163+
user_email: 'github-actions[bot]@users.noreply.github.com'
164+
commit_message: 'docs: update asyncapi documentation'
165+
133166
success:
134167
runs-on: ubuntu-22.04
135168
needs:
136169
- build
137170
- release
138171
- docker-image-delivery
139172
- documentation-deploy
173+
- async-api-deploy
140174
if: >-
141175
always() && (
142176
contains(join(needs.*.result, ','), 'failure')

0 commit comments

Comments
 (0)