Skip to content

Commit

Permalink
Deploy OpenAPI html2 documentation to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Oct 7, 2024
1 parent 3f6858b commit 9dace03
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,47 @@ jobs:
- name: Stop services
run: just down

build-docs:
name: Generate OpenAPI Documentation
if: startsWith(github.ref, 'refs/tags/v')
needs: openapi
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v4
with:
name: openapi_schema
- name: Install the OpenAPI Generator
run: npm install @openapitools/openapi-generator-cli -g
- name: Generate html2
run: |
openapi-generator-cli generate -i schema_split.yaml -g html2 -o dist \
-p [email protected],infoUrl=https://chrisproject.org \
-p licenseInfo=MIT \
-p licenseUrl=${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/LICENSE \
-p pythonPackageName=chris_oag
- name: Upload pages artifact
with:
path: ./dist

deploy-docs:
name: Update GitHub Pages
needs: build-docs
runs-on: ubuntu-24.04

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

draft-release:
name: Draft GitHub Release
runs-on: ubuntu-24.04
Expand Down

0 comments on commit 9dace03

Please sign in to comment.