Skip to content

Commit

Permalink
add new workflow to generate schema website
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed May 20, 2024
1 parent 40cfa2f commit ac0d44d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate schema

on:
push:
paths:
- resources/database/**
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

env:
DB_USER: root # do not change
DB_PASSWORD: root # do not change

steps:
- uses: actions/checkout@v4

- name: Setup database
run: |
mysql -V
sudo /etc/init.d/mysql start
mysql -u$DB_USER -p$DB_PASSWORD -hlocalhost -P3306 < "resources/database/cafe_schema.sql"
mysql -e "USE cafe; SHOW TABLES;" -u$DB_USER -p$DB_PASSWORD
- name: Install spyschema dependencies
run: |
wget https://github.com/schemaspy/schemaspy/releases/download/v6.2.4/schemaspy-6.2.4.jar
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-j-8.4.0.tar.gz
tar -xvzf mysql-connector-j-8.4.0.tar.gz
sudo apt install graphviz
- name: Generate schema spy website
run: |
java -jar schemaspy-6.2.4.jar \
-t mysql \
-dp mysql-connector-j-8.4.0/mysql-connector-j-8.4.0.jar \
-db cafe \
-host localhost \
-u $DB_USER \
-p $DB_PASSWORD \
-o dist \
-s cafe
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit ac0d44d

Please sign in to comment.