Skip to content

Commit af99dc6

Browse files
committed
Redoc API 문서 생성
GitHub Actions를 이용해 Redoc API 문서도 만들고 배포. References: - https://github.com/Redocly/redoc - https://redocly.com/redoc
1 parent 6ebbe65 commit af99dc6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,33 @@ jobs:
1313
runs-on: ubuntu-latest
1414
permissions:
1515
contents: write
16-
if: github.ref == 'refs/heads/main'
1716
steps:
1817
- name: Checkout
1918
uses: actions/checkout@v4
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
- name: Install Redocly CLI
22+
run: npm install -g @redocly/cli@latest
2023
- name: Generate Swagger UI for Todo App
2124
uses: Legion2/swagger-ui-action@v1
2225
with:
2326
output: public/todo-app
2427
spec-file: ./todo-app/openapi.yaml
2528
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Generate Redoc API document for Todo App
30+
run: |
31+
redocly build-docs ./todo-app/openapi.yaml -o public/todo-app/redoc.html
2632
- name: Generate Swagger UI for Tickets API
2733
uses: Legion2/swagger-ui-action@v1
2834
with:
2935
output: public/tickets
3036
spec-file: ./tickets/openapi.yaml
3137
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
- name: Generate Redoc API document for Tickets API
39+
run: |
40+
redocly build-docs ./tickets/openapi.yaml -o public/tickets/redoc.html
3241
- name: Deploy to GitHub Pages
42+
if: github.ref == 'refs/heads/main'
3343
uses: peaceiris/actions-gh-pages@v3
3444
with:
3545
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public/

0 commit comments

Comments
 (0)