Skip to content

Commit

Permalink
๐Ÿ“ docs : api ๋ฌธ์„œ ํ†ตํ•ฉ ๋กœ์ง ๋ณ€๊ฒฝ
Browse files Browse the repository at this point in the history
  • Loading branch information
DDonghyeo authored May 17, 2024
1 parent fd21c96 commit fd39e69
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/apiDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: API Docs Integration
on:
push:
branches:
- docs/#44
- docs/#52
- develop

jobs:
document:
Expand All @@ -14,36 +15,45 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: 'docs/#44'
ref: 'docs/develop'

# Redoc : json ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€ bundle
# 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: 'bundle ./noti-service/docs/noti.json --output ./noti-service/docs/index.html --ext html'
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'

# - name: Rename Yaml Title & Desc
# run: |
# cat ./noti-service/docs/noti.yaml
# yq -i '.info.title = "PetStore Backend API Document for FrontEnd"' ./noti-service/docs/noti.yaml
# yq -i '.info.description = "Please contact Petstore backend if there are any issues with API"' ./noti-service/docs/noti.yaml

# - name: redoc-cli-github-action
# uses: seeebiii/redoc-cli-github-action@v9
# with:
# args: 'build-docs ./noti-serivce/docs/noti.yaml --output ./noti-serivce/docs/api-docs.html'
# 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'

# ์™„์„ฑ๋œ html ํŒŒ์ผ์„ docs ๋””๋ ‰ํ† ๋ฆฌ์— ๋†“์Šต๋‹ˆ๋‹ค.
- name: save build result to tmp dir
- name: Rename Yaml Title & Desc
run: |
mkdir -p docs
mv ./noti-service/docs/index.html ./docs
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: ./docs/index.html
source: ./index.html
destination_folder: docs
destination_repo: WaitherTeam/WaitherTeam.github.io
destination_branch: main
Expand Down

0 comments on commit fd39e69

Please sign in to comment.