Skip to content

Merge pull request #541 from woowacourse-teams/refactor/539-batch #26

Merge pull request #541 from woowacourse-teams/refactor/539-batch

Merge pull request #541 from woowacourse-teams/refactor/539-batch #26

name: API OpenAPI Generate
on:
push:
branches: [dev]
paths: server/**
workflow_dispatch:
jobs:
deploy:
defaults:
run:
working-directory: server
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: yozm-cafe
MYSQL_ROOT_PASSWORD: root
ports:
- 20000:3306
steps:
- name: Use repository source
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate Open API Specification
run: ./gradlew openapi3
- name: Move to api directory
run: cat server/build/api-spec/openapi3.yaml > api/openapi.yaml
working-directory: ./
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
destination_dir: api-docs