feat: Add Swagger Spec #3
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: 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 |