Skip to content

feat: GitHub Actions에 Redoc 문서 자동 배포 추가 (#292) #85

feat: GitHub Actions에 Redoc 문서 자동 배포 추가 (#292)

feat: GitHub Actions에 Redoc 문서 자동 배포 추가 (#292) #85

Workflow file for this run

name: Release CI/CD
on:
push:
branches:
- feature/292
jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# fetch-tags: true
#
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# distribution: 'corretto'
# java-version: '17'
#
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
#
# - name: Build with Gradle
# run: ./gradlew clean build
#
# - name: Get current time
# uses: josStorer/[email protected]
# id: current-time
# with:
# format: YYYY-MM-DDTHH-mm-ss
# utcOffset: "+09:00"
#
# - name: Generate deployment package
# run: |
# mkdir -p deploy
# cp build/libs/*.jar deploy/application.jar
# cp -r .ebextensions deploy/.ebextensions
# cd deploy && zip -r smunity.zip .
#
# - name: Beanstalk Deploy
# uses: einaregilsson/beanstalk-deploy@v20
# with:
# aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# application_name: smunity
# environment_name: smunity-env
# version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
# region: ap-northeast-2
# deployment_package: deploy/smunity.zip
docs:
name: Build & Deploy API Docs (Redoc → GitHub Pages)
runs-on: ubuntu-latest
# needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- name: Generate OpenAPI (offline)
run: ./gradlew clean generateOpenApiDocs
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Redoc CLI
run: npm i -g redoc-cli
- name: Build Redoc (HTML)
run: |
mkdir -p public
redoc-cli bundle build/openapi.json -o public/index.html
- name: Upload artifact for Pages
uses: actions/upload-pages-artifact@v3
with:
path: public
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4