2020-10-22 08:36:19 +03:00
|
|
|
name: javascript-packages
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2024-07-03 00:03:45 +03:00
|
|
|
- openapi.yaml
|
2020-10-22 08:36:19 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
name: Generate API Documentation
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-09-05 23:50:59 +03:00
|
|
|
- name: Check out pull request code
|
2024-05-04 01:39:59 +03:00
|
|
|
uses: actions/checkout@v4
|
2024-09-05 23:50:59 +03:00
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
with:
|
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
|
|
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
if: github.event_name == 'push'
|
2020-10-22 08:36:19 +03:00
|
|
|
|
2024-05-04 01:39:59 +03:00
|
|
|
- name: Run redoc on openapi.yaml
|
|
|
|
run: |
|
2024-07-03 00:21:47 +03:00
|
|
|
npx @redocly/cli --config docs/api/redocly.yaml build-docs openapi.yaml -o docs/api/index.html
|
2020-10-22 08:36:19 +03:00
|
|
|
|
2024-05-04 01:39:59 +03:00
|
|
|
- name: Commit changes
|
|
|
|
uses: EndBug/add-and-commit@v9
|
|
|
|
with:
|
|
|
|
author_name: Owncast
|
|
|
|
author_email: owncast@owncast.online
|
|
|
|
message: 'Commit updated API documentation'
|
|
|
|
add: 'docs/api/index.html'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|