Merge pull request #543 from woowacourse-teams/test/542-DataInitializer #23
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
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 |