Update apiDocs.yml #47
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: | |
api-docs-integration: | |
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 | |
# - name : join | |
# run : | | |
# redocly join ./noti.json ./user.json ./weather.json -o ./api.json | |
# # Redoc : json 파일 join | |
# - name: redoc-cli-github-action | |
# uses: seeebiii/redoc-cli-github-action@v9 | |
# with: | |
# args: 'join ./noti.json ./user.json ./weather.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@v10 | |
with: | |
args: 'join user.json noti.json weather.json -o api.yaml' | |
- name: check result | |
run: | | |
ls -al | |
test -f api.yaml || (echo "Missing api.yaml from previous step." && exit 1) | |
# - 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@v10 | |
with: | |
args: 'build-docs api.yaml -o index.html' | |
- name: check result | |
run: | | |
ls -al | |
test -f index.html || (echo "Missing index.html from previous step." && exit 1) | |
# 웹페이지 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 }} |