Generate CCMM diagram #13
This file contains hidden or 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 CCMM diagram | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'flattenCCMM/output/ccmm_merged.xsd' | |
| - 'ceCCMM/scripts/ccmm-xsd-vis.py' | |
| workflow_dispatch: | |
| jobs: | |
| build-diagram: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| # 1. sousteni skriptu | |
| - name: Generate PlantUML source | |
| run: | | |
| python ceCCMM/ccmm-xsd-vis.py > diagram.puml | |
| echo "--- generovany obsah ---" | |
| cat diagram.puml | |
| echo "----------------------------------" | |
| # 2. renderovani do png | |
| - name: Render PNG | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y graphviz | |
| # Stažení JARu PlantUML | |
| curl -L https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar -o plantuml.jar | |
| # Spuštění - PlantUML si teď 'dot' najde automaticky v /usr/bin/dot | |
| java -jar plantuml.jar -tpng diagram.puml | |
| # 3. Commit a Push | |
| - name: Commit and Push diagram | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add ceCCMM/output/diagram.png | |
| git commit -m "docs: diagram automatic update [skip ci]" || exit 0 | |
| git push |