๐docs : api docs ์์ #37
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: API Docs Integration | |
on: | |
push: | |
branches: | |
- docs/#52 | |
- develop | |
jobs: | |
document: | |
runs-on: ubuntu-latest | |
steps: | |
# ํ๋ก์ ํธ ์ฝ๋๋ฅผ ๊ฐ์ ธ์ต๋๋ค. | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: 'develop' | |
# Json ํ์ผ ๊ฐ์ ธ์ค๊ธฐ | |
- name : collect json | |
run : | | |
cp ./noti-service/docs/noti.json ./ | |
cp ./user-service/docs/user.json ./ | |
cp ./weather-service/docs/weather.json ./ | |
ls -all | |
# Redoc : json ํ์ผ join | |
# - name: redoc-cli-github-action | |
# uses: seeebiii/redoc-cli-github-action@v9 | |
# with: | |
# args: 'join ./noti.json ./user.json -o ./api.json' | |
# - name : ls | |
# run : | | |
# pwd | |
# ls -all | |
# ls /github/workspace | |
# Redoc : json ํ์ผ join | |
- name: redoc-cli-github-action | |
uses: seeebiii/redoc-cli-github-action@v9 | |
with: | |
args: 'bundle ./noti.json ./user.json ./weather.json --output ./api.yaml --ext yaml' | |
# - name: Rename Yaml Title & Desc | |
# run: | | |
# cat ./api.yaml | |
# yq -i '.info.title = "Waither Backend API Document for FrontEnd"' ./api.yaml | |
# yq -i '.info.description = "Please contact Petstore backend if there are any issues with API"' ./api.yaml | |
- name: redoc-cli-github-action | |
uses: seeebiii/redoc-cli-github-action@v9 | |
with: | |
args: 'build-docs ./api.yaml --output ./index.html' | |
# ์นํ์ด์ง Repository์ Push ํฉ๋๋ค. | |
- name: Install SSH Key | |
uses: leigholiver/[email protected] | |
with: | |
source: ./index.html | |
destination_folder: docs | |
destination_repo: WaitherTeam/WaitherTeam.github.io | |
destination_branch: main | |
deploy_key: ${{ secrets.DEPLOY_KEY }} |