-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 changed file
with
53 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,53 @@ | ||
name: generate noti-service api docs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Input branch info you want to generate' | ||
required: true | ||
|
||
jobs: | ||
document: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
|
||
- name: get doc | ||
run: | | ||
./gradlew :noti-service:clean :noti-service:generateOpenApiDocs | ||
- name: generate document html | ||
run: | | ||
cp noti-service/build/docs/noti.json ./ | ||
redocly bundle noti.json --output noti.yaml --ext yaml | ||
yq -i '.info.title = "Noti-Service API Document"' noti.yaml | ||
yq -i '.info.description = "Please contact Petstore backend if there are any issues with API"' noti.yaml | ||
redocly build-docs noti.yaml --output noti.html | ||
- name: save build result to tmp dir | ||
run: | | ||
mkdir -p ../docs | ||
mv noti.html ../docs | ||
- name: Checkout document branch | ||
uses: actions/checkout@v3 | ||
# with: | ||
# ref: 'main' | ||
|
||
# - name: Move build artifacts | ||
# run: | | ||
# mkdir -p petstore # replace with your target path | ||
# cp -R -f ../../_temp/petstore-fe.html petstore/fe.html | ||
# | ||
# - name: Commit and push build artifacts | ||
# run: | | ||
# git config user.name "GitHub Actions" | ||
# git config user.email "[email protected]" | ||
# git add . | ||
# git commit -m "Commit document artifacts" | ||
# git push |