forked from Sports-day/SportsDayAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.65 KB
/
tbls.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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'