Created
May 30, 2025 16:46
-
-
Save scorpp/3efbf1ef817f9592124709bbb1c08b95 to your computer and use it in GitHub Desktop.
Revisions
-
scorpp created this gist
May 30, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # Rendering PlantUML with GitHub Actions None of existing GitHub Actions is perfect, most are outdated, others use PlantUML Server, which doesn't work well for private repos. ## What's included - Flow triggers for \*.puml file changes only - Uses latest PlantUML docker image (but version could be adjusted) - Allows you to customise any aspect of rendering by adjusting CLI args - Commits rendered images automatically in a separate commit That's all was made possible by using nice `tj-actions/docker-run` action. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ name: Generate PlantUML Diagrams on: push: paths: - "**.puml" jobs: plant-uml: runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }}- cancel-in-progress: true steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # fetch whole repo history - name: Get all changed markdown files id: changed-files uses: tj-actions/changed-files@v46 # v46 with: # Avoid using single or double quotes for multiline patterns files: | **.puml - name: Generate Diagrams uses: tj-actions/[email protected] if: steps.changed-files.outputs.any_changed == 'true' with: image: ghcr.io/plantuml/plantuml:latest name: plantuml options: '-v ${{ github.workspace }}:/data' args: | -tsvg -v ${{steps.changed-files.outputs.all_changed_files}} - name: Push Local Changes uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "${{ github.event.head_commit.message }} - Puml" branch: ${{ github.head_ref }}