๐docs : api docs ์์ #46
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 --output 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 --ouput 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 }} |