Publish OnCourse API documentation #9
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: Publish OnCourse API documentation | |
on: | |
workflow_run: | |
workflows: ["Release"] | |
types: [completed] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.14.2] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Generate swagger | |
run: ./gradlew clean server-api:apiDocs_mergeSwagger | |
- name: Build | |
working-directory: ./api-doc | |
run: | | |
npm install | |
npm run build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./api-doc/build/api-docs | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |