UI updates and hotfix to api to fix starlette issue #27
Workflow file for this run
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: OpenAPI JSON to gh-pages (<url>/openapi.json) | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
openapijson_to_gh-pages: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build openapi.json | |
run: | | |
eval "$(ssh-agent -s)" && export DOCKER_BUILDKIT=1 && docker build --ssh default --target openapi -t rasenmaeher_api:amd64-openapi api/ | |
docker run --rm --name rasenmaeher_openapijson rasenmaeher_api:amd64-openapi >openapi.json | |
- name: Generate Swagger UI | |
uses: Legion2/swagger-ui-action@v1 | |
with: | |
output: swagger-ui | |
spec-file: openapi.json | |
version: ^5.0.0 | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: swagger-ui | |
keep_files: true |