Skip to content

Redoc API 문서 생성 #6

Redoc API 문서 생성

Redoc API 문서 생성 #6

name: Build and Deploy
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install Redocly CLI
run: npm install -g @redocly/cli@latest
- name: Generate Swagger UI for Todo App
uses: Legion2/swagger-ui-action@v1
with:
output: public/todo-app
spec-file: ./todo-app/openapi.yaml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Redoc API document for Todo App
run: |
redocly build-docs ./todo-app/openapi.yaml -o public/todo-app/redoc.html
- name: Generate Swagger UI for Tickets API
uses: Legion2/swagger-ui-action@v1
with:
output: public/tickets
spec-file: ./tickets/openapi.yaml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Redoc API document for Tickets API
run: |
redocly build-docs ./tickets/openapi.yaml -o public/tickets/redoc.html
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
keep_files: true