-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (67 loc) · 2.05 KB
/
diagram.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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@v5
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 "chore: Auto-generate UML diagram"
git push
else
echo "No changes to commit. Skipping commit step."
fi