-
Notifications
You must be signed in to change notification settings - Fork 131
43 lines (37 loc) · 1.22 KB
/
doc.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
41
42
43
name: Docs
on:
push:
branches:
- main
- v3
paths:
- "api/**"
- "docs/api/**"
workflow_dispatch:
jobs:
sync:
name: Sync
runs-on: ubuntu-22.04
env:
VERSION: v2
ID: 626badcabbc59c02acc1a53f
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Detect PMM version and API ID
run: |
# For reference:
# PMM 2: VERSION=v2, ID=626badcabbc59c02acc1a53f
# PMM 3: VERSION=v3, ID=622892a957a7410330bc6184
export VERSION=$(cat api/swagger/swagger.json | jq -r '.info.version')
export ID=$(cat api/swagger/swagger.json | jq -r '."x-readme-id"')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "ID=$ID" >> $GITHUB_ENV
- name: API
uses: readmeio/rdme@51a80867c45de15e2b41af0c4bd5bbc61b932804 # v8.6.6
with:
rdme: openapi ./api/swagger/swagger.json --id=${{ env.ID }} --key=${{ secrets.README_TOKEN }}
- name: Markdown docs
uses: readmeio/rdme@51a80867c45de15e2b41af0c4bd5bbc61b932804 # v8.6.6
with:
rdme: docs docs/api --version=${{ env.VERSION }} --key=${{ secrets.README_TOKEN }}