forked from OpenSourceFellows/amplify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Deploy OpenAPI Documentation to GitHub Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'openapi.yml' | ||
|
||
jobs: | ||
upload-openapi-spec: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Upload openapi.yml | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: spec-file | ||
path: openapi.yml | ||
generate-openapi-ui: | ||
name: Generate Swagger UI and Deploy to Pages | ||
needs: upload-openapi-spec | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download openapi.yml | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: spec-file | ||
|
||
- name: Generate Swagger UI | ||
uses: Legion2/swagger-ui-action@v1 | ||
with: | ||
output: api-docs | ||
spec-file: openapi.yml | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: api-docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Lint OpenAPI Spec | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'openapi.yml' | ||
- docs/api_docs/ | ||
|
||
jobs: | ||
lint-spec: | ||
runs-on: ubuntu-latest | ||
name: Lint OpenAPI Spec | ||
steps: | ||
- uses: mshick/add-pr-comment@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
message: | | ||
Looks like you've updated the OpenAPI spec! Make sure to: | ||
- check the output of the `Lint OpenAPI Spec` action | ||
- run `script/lint-and-bundle-openapi-schema.sh` and commit any resulting changes. | ||
- uses: actions/checkout@v2 | ||
- name: Lint OpenAPI Spec | ||
uses: trybeapp/[email protected] | ||
with: | ||
args: 'lint openapi.yml --extends=minimal --skip-rule=no-empty-servers' |
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