From 03151f1dd12da7717e1c2b27fa031474b8b40504 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 21 Oct 2020 22:36:19 -0700 Subject: [PATCH] Render api documentation when openapi.yaml is updated --- .../workflows/generate-api-documentation.yaml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/generate-api-documentation.yaml diff --git a/.github/workflows/generate-api-documentation.yaml b/.github/workflows/generate-api-documentation.yaml new file mode 100644 index 000000000..a3791b3bd --- /dev/null +++ b/.github/workflows/generate-api-documentation.yaml @@ -0,0 +1,28 @@ +name: javascript-packages +on: + push: + paths: + - openapi.yaml + +jobs: + run: + name: Generate API Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Run redoc on openapi.yaml + run: | + npx redoc-cli bundle openapi.yaml -o doc/api/index.html --options '{"hideHostname": true, "pathInMiddlePanel": true} + npm run build + + - name: Commit changes + uses: EndBug/add-and-commit@v5 + with: + author_name: Owncast + author_email: owncast@owncast.online + message: "Commit updated API documentation" + add: "doc/api/index.html" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}