-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.94 KB
/
generate-devops-api.yaml
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
name: Generate API References
on:
workflow_dispatch:
inputs:
clientsRepoRef:
description: 'What (ref) branch to use for the DevOps API spec'
required: true
type: string
default: 'main'
clientsRepo:
description: 'What repo to use for the DevOps API spec'
required: true
type: string
default: 'datastax/astra-streaming-clients'
jobs:
Generate-Specs:
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v2
with:
path: docs
- name: Checkout Astra Streaming Clients
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.clientsRepo }}
ref: ${{ github.event.inputs.clientsRepoRef }}
path: astra-streaming-clients
token: ${{ secrets.DATASTAX_GH_TOKEN }}
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install redocly
run: npm i -g @redocly/cli@latest
- name: Generate DevOps API docs
continue-on-error: false
run: redocly build-docs astra-streaming-clients/specs/devops/swagger.yaml --output docs/modules/apis/attachments/devops.html
- name: Generate Pulsar Admin API docs
continue-on-error: false
run: redocly build-docs astra-streaming-clients/specs/pulsar-admin/swagger.yaml --output docs/modules/apis/attachments/pulsar-admin.html
- name: Create random string
run: echo RANDOM_STR=$(date +%s) >> $GITHUB_ENV
- name: Add, Commit, and Push
uses: EndBug/add-and-commit@v9
with:
cwd: ./docs
committer_name: GitHub Actions
committer_email: [email protected]
new_branch: generated-api-docs-${{ env.RANDOM_STR }}
message: 'Automated generation of API docs'
push: true