Skip to content

Commit

Permalink
Merge pull request #146 from Johennes/johannes/generate-images
Browse files Browse the repository at this point in the history
Use common action for generating images
  • Loading branch information
gem-uhe authored Dec 3, 2024
2 parents 06200ad + 1819fb9 commit 43e96a8
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions .github/workflows/GeneratePlantumlImages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,18 @@ name: GeneratePlantumlImages

on:
push:
branches: [ '*' ]
paths: [ 'src/plantuml/**' ]
branches: [ '**' ]
paths: [ '.github/workflows/GeneratePlantumlImages.yml', 'src/plantuml/**', 'images/diagrams/**' ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Generate images
run: |
mkdir -p images/diagrams
rm -rf images/diagrams/*
for fullname in src/plantuml/*.puml
do
base=$(basename -- "$fullname")
echo ${base%.*}
curl --silent --show-error --fail -H "Content-Type: text/plain; charset=utf-8" \
--data-binary @- https://plantuml.gematik.solutions/plantuml/svg/ \
--output - < "src/plantuml/${base%.*}.puml" > "images/diagrams/${base%.*}.svg"
curl --silent --show-error --fail -H "Content-Type: text/plain; charset=utf-8" \
--data-binary @- https://plantuml.gematik.solutions/plantuml/png/ \
--output - < "src/plantuml/${base%.*}.puml" > "images/diagrams/${base%.*}.png"
done
- name: Add & Commit
uses: EndBug/add-and-commit@v8
with:
add: 'images/diagrams/'
uses: gematik/github-image-actions/.github/workflows/generate-images.yml@0.3.0
with:
srcdir: src/plantuml
outdir: images/diagrams
ref: 0.3.0
png: true
svg: true

0 comments on commit 43e96a8

Please sign in to comment.