Skip to content

Merge pull request #901 from eol-uchile/tpeet/bump_openuchile_theme #258

Merge pull request #901 from eol-uchile/tpeet/bump_openuchile_theme

Merge pull request #901 from eol-uchile/tpeet/bump_openuchile_theme #258

Workflow file for this run

name: Generate Diagram
on:
push:
branches:
- 'openuchile-release/koa'
- 'eol-release/koa'
paths:
- 'Dockerfile'
- 'requirements/**.txt'
- '.github/workflows/diagram.yml'
- 'templates/diagram_template.j2'
- 'themes/**'
- '.gitmodules'
- 'gen_deps_diagram.py'
# Required for the workflow to be reused by other repositories.
workflow_call:
secrets:
SECRET_DIAGRAM:
required: true
permissions:
contents: write
jobs:
generate_diagram:
runs-on: ubuntu-latest
name: PlantUML Diagram
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: 'recursive'
token: ${{ secrets.SECRET_DIAGRAM }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install Jinja2==3.0.3
shell: bash
- name: Create templates directory
run: test -d templates || mkdir templates
- name: Download template
run: wget https://github.com/eol-uchile/edx-staging/raw/eol-release/koa/templates/diagram_template.j2 -O templates/diagram_template.j2
- name: Download diagram generator script
run: wget https://github.com/eol-uchile/edx-staging/raw/eol-release/koa/gen_deps_diagram.py -O gen_deps_diagram.py
- name: Generate diagram.puml
run: python gen_deps_diagram.py
- name: Draw diagram
uses: Timmy/plantuml-action@v1
with:
args: '-tsvg diagrams/diagram.puml'
- name: Configure Git
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Commit UML Images
run: |
if [ "$(git status --porcelain diagrams/)" != "" ]
then
git add diagrams/**
git commit -m "Auto-generate UML diagram"
git push
else
echo "No changes to commit. Skipping commit step."
fi