📝 docs : api 문서 통합 로직 변경 #26
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: 'docs/develop' | |
# Json 파일 가져오기 | |
- name : collect json | |
run : | | |
cp ./noti-service/docs/noti.json ./ | |
cp ./user-service/docs/user.json ./ | |
cp ./weather-service/docs/weather.json ./ | |
# Redoc : json 파일 join | |
- name: redoc-cli-github-action | |
uses: seeebiii/redoc-cli-github-action@v9 | |
with: | |
args: 'join noti.json --prefix-tags-with-filename=true user.json --prefix-tags-with-filename=true weather.json --prefix-tags-with-filename=true --output api.json' | |
# Redoc : json 파일 join | |
- name: redoc-cli-github-action | |
uses: seeebiii/redoc-cli-github-action@v9 | |
with: | |
args: 'bundle api.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 }} |