-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 982 Bytes
/
openapi-merge.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
name: Merge OpenAPI Specs
on:
push:
branches:
- docs
jobs:
merge-openapi-specs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install redoc-cli
run: npm install -g redoc-cli
- name: Merge OpenAPI specs
run: |
echo "::group::Merging OpenAPI specs"
jq -s '.[0] * .[1]' docs/petstore-api-docs.json docs/user-api-docs.json > docs/merged-api-docs.json
echo "::endgroup::"
- name: Generate Redoc HTML
run: |
mkdir -p public
redoc-cli bundle docs/merged-api-docs.json -o public/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages