Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit 25710ba

Browse files
authored
docs: configure api docs generation (#34)
* docs: configure api docs generation * workflow for updating api docs on docs commit
1 parent 67537ae commit 25710ba

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Update generated parts of documentation on docs: commits'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
docs-gen:
10+
name: 'Generate docs and create PR'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Regenerate docs
22+
run: npm run generate:assets
23+
- name: Create Pull Request with updated docs
24+
# PR should be created within this GH action only if it is a docs: commit
25+
# Otherwise it will conflict with release workflow
26+
if: startsWith(github.event.commits[0].message, 'docs:')
27+
uses: peter-evans/create-pull-request@v3
28+
with:
29+
token: ${{ secrets.GH_TOKEN }}
30+
commit-message: 'chore: update generated docs'
31+
committer: asyncapi-bot <info@asyncapi.io>
32+
author: asyncapi-bot <info@asyncapi.io>
33+
title: 'chore: update generated docs'
34+
body: 'Update of docs that are generated and were forgotten on PR level.'
35+
branch: gen-docs-update

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"get:version": "echo $npm_package_version",
7474
"get:name": "echo $npm_package_name",
7575
"release": "semantic-release",
76-
"generate:assets": "npm run docs",
76+
"generate:assets": "npm run prepublishOnly && npm run docs",
7777
"generate:readme:toc": "markdown-toc -i README.md",
7878
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
7979
"prepublishOnly": "npm run build"

0 commit comments

Comments
 (0)