Skip to content

Commit

Permalink
PMM-12985 Create v3 API infra (#3116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff authored Aug 2, 2024
1 parent a06f8fd commit 5393895
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 13,366 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,41 @@ on:
push:
branches:
- main
- v3
paths:
- "api/**"
- "docs/api/**"

workflow_dispatch:
inputs:
version:
description: "API Version on readme.io"
required: true
default: "v1.0" # v0.0 stands for the dev version

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=626badcabbc59c02acc1a53f --key=${{ secrets.README_TOKEN }}
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=${{ github.event.inputs.version || 'v1.0' }} --key=${{ secrets.README_TOKEN }}
rdme: docs docs/api --version=${{ env.VERSION }} --key=${{ secrets.README_TOKEN }}
5 changes: 3 additions & 2 deletions api/swagger/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"title": "PMM API",
"version": "public"
"version": "v2"
},
"schemes": [
"https",
Expand All @@ -25,5 +25,6 @@
"node",
"python"
]
}
},
"x-readme-id": "626badcabbc59c02acc1a53f"
}
Loading

0 comments on commit 5393895

Please sign in to comment.