Generate Diagrams #118
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: Generate Diagrams | |
on: | |
workflow_dispatch: | |
#push: # push must be changed to trigger after md's have been generated (workflow trigger) | |
workflow_run: | |
workflows: [Generate cleaned vocabulary and packages] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
generate-diagrams-for-generated-mds: | |
runs-on: ubuntu-latest | |
env: | |
DEFINITION_FOLDER: "${{ github.workspace }}/docs/vocabulary_development/auto-generated/md/definition-files" | |
OUTPUT_FOLDER: "${{ github.workspace }}/docs/vocabulary_development/diagrams" | |
PNGFILE_FOLDER: "${{ github.workspace }}/docs/vocabulary_development/diagrams/generated" | |
SCRIPT_PATH: "${{ github.workspace }}/docs/vocabulary_development/scripts" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Generate diagrams | |
run: | | |
cd $SCRIPT_PATH | |
pip install -r requirements.txt | |
python generate_diagrams.py | |
- name: Commit back to repo | |
run: | | |
git config --global user.name "Github Actions" | |
git config --global user.email actions@github.com | |
git add --all | |
git commit -m "[ci] Updated autogenerated diagrams" | |
git push | |
#also upload the generated files as artifacts. possibly not strictly neccessary | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: generated-diagrams | |
path: ${{ env.PNGFILE_FOLDER }} | |