ci: add render-diagrams workflow (.puml → .png committed back to repo)
This commit is contained in:
42
.gitea/workflows/render-diagrams.yml
Normal file
42
.gitea/workflows/render-diagrams.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Render PlantUML Diagrams
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main", "develop", "release/**"]
|
||||||
|
paths:
|
||||||
|
- "docs/diagrams/**.puml"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
render:
|
||||||
|
name: Render .puml → .png
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Install Java & Graphviz
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y --no-install-recommends default-jre-headless graphviz
|
||||||
|
|
||||||
|
- name: Download PlantUML jar
|
||||||
|
run: |
|
||||||
|
curl -sSL -o /usr/local/bin/plantuml.jar \
|
||||||
|
https://github.com/plantuml/plantuml/releases/download/v1.2024.6/plantuml-1.2024.6.jar
|
||||||
|
|
||||||
|
- name: Render diagrams
|
||||||
|
run: |
|
||||||
|
java -jar /usr/local/bin/plantuml.jar -tpng -o . docs/diagrams/*.puml
|
||||||
|
|
||||||
|
- name: Commit rendered PNGs
|
||||||
|
run: |
|
||||||
|
git config user.name "gitea-actions[bot]"
|
||||||
|
git config user.email "gitea-actions[bot]@i3omb.com"
|
||||||
|
git add docs/diagrams/*.png
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No diagram changes to commit."
|
||||||
|
else
|
||||||
|
git commit -m "ci: render PlantUML diagrams [skip ci]"
|
||||||
|
git push
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user