Skip to content

Instantly share code, notes, and snippets.

@owulveryck
Created March 30, 2021 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owulveryck/79812bbc0ffbd3f20a3888b34916eebb to your computer and use it in GitHub Desktop.
Save owulveryck/79812bbc0ffbd3f20a3888b34916eebb to your computer and use it in GitHub Desktop.
GitHub action to generate plantuml files
name: Generate PlantUML Diagrams
on:
push:
branches:
- main
jobs:
plantuml:
runs-on: ubuntu-latest
env:
UML_FILES: ".puml"
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
name: "Get PUML files"
id: filter
with:
list-files: 'shell'
base: 'main'
filters: |
puml:
- '**.puml'
- name: Generate SVG Diagrams
uses: cloudbees/plantuml-github-action@master
if: steps.filter.outputs.puml == 'true'
with:
args: -v -tsvg ${{ steps.filter.outputs.puml_files }}
- name: Generate PNG Diagrams
uses: cloudbees/plantuml-github-action@master
if: steps.filter.outputs.puml == 'true'
with:
args: -v -tpng ${{ steps.filter.outputs.puml_files }}
- name: Push Local Changes
if: steps.filter.outputs.puml == 'true'
uses: stefanzweifel/git-auto-commit-action@v4.1.2
with:
commit_user_name: "CI GitHub Action"
commit_user_email: "ci@mail.net"
commit_author: "CI GitHub Action <ci@mail.net>"
commit_message: "Generate SVG and PNG images for PlantUML diagrams"
branch: ${{ github.head_ref }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment