Seederのアップデート #61
Workflow file for this run
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: ER Diagram (tbls) | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
doc: | |
runs-on: ubuntu-20.04 | |
services: | |
db: | |
image: mysql:8.0 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: db | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute seeder | |
run: ./gradlew runSeeder | |
env: | |
DATABASE_HOST: localhost | |
DATABASE_PORT: 3306 | |
DATABASE_USER: root | |
DATABASE_PASSWORD: password | |
DATABASE_DB: db | |
- uses: k1low/setup-tbls@v1 | |
- name: Run tbls for generate database document | |
run: tbls doc --rm-dist my://root:password@localhost:3306/db | |
- name: Diff | |
id: diff | |
run: | | |
git add -N dbdoc | |
git diff --name-only --exit-code | |
continue-on-error: true | |
- name: Commit & Push | |
run: | | |
set -x | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add dbdoc | |
git commit --author=. -m 'docs: update er diagram' | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} | |
if: steps.diff.outcome == 'failure' |