Update apidocs.yml #17
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: generate noti-service api docs | |
on: | |
push: | |
branches: | |
- docs/#44 | |
- develop | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Input branch info you want to generate' | |
required: true | |
jobs: | |
document: | |
runs-on: ubuntu-latest | |
steps: | |
#저장소 코드를 내려받습니다. | |
- uses: actions/checkout@v3 | |
with: | |
ref: docs/#44 | |
#Setting yml | |
# - name: make application.yml | |
# run: | | |
# touch ./noti-service/src/main/resources/bootstrap.yml | |
# echo "${{ secrets.NOTI_APPLICATION_YML }}" > ./noti-service/src/main/resources/bootstrap.yml | |
#Java Set up | |
# - name: Set up JDK 17 | |
# uses: actions/setup-java@v3 | |
# with: | |
# java-version: '17' | |
# distribution: 'zulu' | |
#Gradle 명령어로 ApiDocs를 생성합니다. | |
# - name: get doc | |
# run: | | |
# cd ./noti-service | |
# ls -all | |
# ./gradlew :clean :generateOpenApiDocs | |
#redoc Set up | |
- name: redocly-cli | |
# You may pin to the exact commit or the version. | |
# uses: DeltaLaboratory/redocly-cli-action@34bfb03df7e3412b75b1f4086c3fd46e82fa5e33 | |
uses: DeltaLaboratory/[email protected] | |
- name: generate document html | |
run: | | |
cd ./noti-service | |
cp ./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: | | |
cd .. | |
mkdir -p docs | |
mv ./noti-service/noti.html docs | |
- name: Commit & Push | |
run: | | |
git add . | |
git commit -m "📝docs : Generate Docs" | |
git push origin apiDocs | |
# - 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 | |