Merge pull request #46 from TrailBuddies/snyk-fix-d0d8f0a1a272d7ab75c… #140
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: Docs | |
env: | |
# Required app environment variables | |
# https://github.com/TrailBuddies/api#environment-variables | |
DEV_API_DB_USER: test | |
DEV_API_DB_PASSWORD: test | |
EMAIL: [email protected] | |
PASSWORD: test1234 | |
# CLOUDINARY_SECRET: ${{ secrets.CLOUDINARY_SECRET }} | |
# TOMTOM_API_KEY: ${{ secrets.TOMTOM_API_KEY }} | |
PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
erd: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: ${{ env.DEV_API_DB_USER }} | |
POSTGRES_DB: ${{ env.DEV_API_DB_USER }} | |
POSTGRES_PASSWORD: ${{ env.DEV_API_DB_PASSWORD }} | |
ports: [ '5432:5432' ] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
PASSPHRASE: test-${{ matrix.os }}-${{ github.run_id }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: ts-graphviz/setup-graphviz@v1 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.1.2 | |
- name: Setup Rails Database | |
run: bin/keygen && bin/rails db:setup | |
- name: Generate ERD | |
run: rake erd title="API Models Diagram" filetype=png filename=docs/ERD notation=bachman exclude="ActiveStorage::VariantRecord,ActiveStorage::Blob,ActiveStorage::Attachment" | |
- name: Commit ERD | |
run: | | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git config --global user.name 'Github Actions' | |
git pull --commit | |
git add docs/ERD.png | |
git diff --quiet && git diff --staged --quiet || git commit -m '[docs] Generate ERD' | |
git push |