diff --git a/.github/workflows/plantuml.yaml b/.github/workflows/plantuml.yaml new file mode 100644 index 0000000..52f9c43 --- /dev/null +++ b/.github/workflows/plantuml.yaml @@ -0,0 +1,40 @@ +name: plantuml + +on: + push: + branches: [ '*' ] + paths: [ 'src/plantuml/**' ] + + # 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/' \ No newline at end of file