-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ docs : api ๋ฌธ์ ํตํฉ ๋ก์ง ๋ณ๊ฒฝ
- Loading branch information
Showing
1 changed file
with
28 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ name: API Docs Integration | |
on: | ||
push: | ||
branches: | ||
- docs/#44 | ||
- docs/#52 | ||
- develop | ||
|
||
jobs: | ||
document: | ||
|
@@ -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 | ||
|