Skip to content

Merge pull request #48 from gsainfoteam/43-sgh #13

Merge pull request #48 from gsainfoteam/43-sgh

Merge pull request #48 from gsainfoteam/43-sgh #13

Workflow file for this run

name: update erd
on:
push:
paths:
- 'prisma/schema.prisma'
branches:
- main
jobs:
build:
name: Generate and Build ERD
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.DBDOCS_COMMIT_KEY }}
- name: Install prisma-dbml-generator
run: sudo npm install -g prisma-dbml-generator
- name: Generate dbml
run: npx prisma generate
- name: Install dbdocs
run: sudo npm install -g dbdocs
- name: Check dbdocs
run: dbdocs --version
- name: Build and Update ERD
run: dbdocs build ./prisma/dbml/schema.dbml
env:
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
- name: Check if there are any changes
id: check_changes
run: |
git diff --quiet . || echo "changed=true" >> "$GITHUB_OUTPUT"
- name: Commit and Push
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions [bot]"
git commit -am "Update dbml"
git push -u origin main