1
+ # This workflow is centrally managed in https://github.com/asyncapi/.github/
2
+ # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
3
+
4
+ # The given workflow is responsible for generating docs and creating PR with them when there is a commit with docs: prefix
5
+
6
+ # This workflow will be updated in all repos with the topic get-global-docs-autoupdate
7
+
8
+ name : ' Update generated parts of documentation on docs: commits'
9
+
10
+ on :
11
+ push :
12
+ branches :
13
+ - master
14
+
15
+ jobs :
16
+ docs-gen :
17
+ name : ' Generate docs and create PR'
18
+ runs-on : ubuntu-latest
19
+ # PR should be created within this GH action only if it is a docs: commit
20
+ # Otherwise it will conflict with release workflow
21
+ if : startsWith(github.event.commits[0].message, 'docs:')
22
+ steps :
23
+ - name : Checkout repo
24
+ uses : actions/checkout@v4
25
+ - name : Check package-lock version
26
+ uses : asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
27
+ id : lockversion
28
+ - name : Use Node.js
29
+ uses : actions/setup-node@v3
30
+ with :
31
+ node-version : " ${{ steps.lockversion.outputs.version }}"
32
+ cache : ' npm'
33
+ cache-dependency-path : ' **/package-lock.json'
34
+ - name : Install dependencies
35
+ run : npm ci
36
+ - name : Regenerate docs
37
+ run : npm run generate:assets --if-present
38
+ - name : Create Pull Request with updated docs
39
+ uses : peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # uses 5.0.2 https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.2
40
+ with :
41
+ token : ${{ secrets.GH_TOKEN }}
42
+ commit-message : ' chore: update generated docs'
43
+ committer :
asyncapi-bot <[email protected] >
44
+ author :
asyncapi-bot <[email protected] >
45
+ title : ' chore: update generated docs'
46
+ body : ' Update of docs that are generated and were forgotten on PR level.'
47
+ branch : gen-docs-update/${{ github.job }}
48
+ - name : Report workflow status to Slack
49
+ if : failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
50
+ uses : 8398a7/action-slack@fbd6aa58ba854a740e11a35d0df80cb5d12101d8 # using https://github.com/8398a7/action-slack/releases/tag/v3.15.1
51
+ with :
52
+ status : ${{ job.status }}
53
+ fields : repo,action,workflow
54
+ text : ' AsyncAPI docs generation workflow failed'
55
+ author_name : asyncapi-bot
56
+ env :
57
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
0 commit comments