Merge branch 'main' into v3 #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- 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@v8 | |
with: | |
rdme: openapi ./api/swagger/swagger.json --id=${{ env.ID }} --key=${{ secrets.README_TOKEN }} | |
- name: Markdown docs | |
uses: readmeio/rdme@v8 | |
with: | |
rdme: docs docs/api --version=${{ env.VERSION }} --key=${{ secrets.README_TOKEN }} |