Skip to content

Merge pull request #955 from WildMeOrg/950_export_collaboration_level #328

Merge pull request #955 from WildMeOrg/950_export_collaboration_level

Merge pull request #955 from WildMeOrg/950_export_collaboration_level #328

name: Generate Models Graph
on:
push:
branches:
- main
paths:
- 'app/modules/**/models.py'
- 'scripts/docs/generate_models_graph.py'
pull_request:
paths:
- 'scripts/docs/generate_models_graph.py'
jobs:
generate-models-graph:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app-context: ["codex", "mws"]
env:
HOUSTON_APP_CONTEXT: ${{ matrix.app-context }}
FLASK_ENV: development
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -r app/requirements.txt
pip install -e .
pip install pydot
sudo apt-get install -y graphviz
- name: Generate models graph
run: ./scripts/docs/generate_models_graph.py
- name: Commit and push to docs
if: github.ref == 'refs/heads/main'
run: |
bash -xe <<EOF
if ! git diff --quiet
then
git add docs/${HOUSTON_APP_CONTEXT}-models-graph.png
git config user.name github-actions
git config user.email github-actions@github.com
git commit -am 'Update docs/models-graph.png'
git push origin HEAD
else
echo nothing to commit
fi
EOF