DEV Community

Romain Lespinasse
Romain Lespinasse

Posted on • Edited on

5

Keep your draw.io diagrams in sync inside your repository

My Workflow

You have Draw.io diagram files on your repository? You export them manually to have them as images (png, jpg) or pdf?

You can keep your diagrams as exported images (png, jpg) or pdf and keep them synchronized when the diagram files are updated.

Submission Category:

  • Maintainer Must-Haves

Yaml File or Link to Code

Example to keep your draw.io files exported as PNG files with associated Asciidoctor pages.

name: Keep draw.io export synchronized
on:
  push:
    branches:
      - master
    paths:
      - "**.drawio"
      - .github/workflows/drawio-export.yml
jobs:
  drawio-export:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.GH_TOKEN }}

      - name: Export drawio files to asciidoctor and png files
        uses: docker://rlespinasse/drawio-export:v3.x
        with:
          args: --fileext adoc --folder drawio-assets --transparent --on-changes

      - name: Get author and committer info from HEAD commit
        uses: rlespinasse/git-commit-data-action@v1.x

      - name: Commit changed files
        uses: stefanzweifel/git-auto-commit-action@v4.1.6
        with:
          commit_message: "docs: sync draw.io exported files"
          commit_user_name: "${{ env.GIT_COMMIT_COMMITTER_NAME }}"
          commit_user_email: "${{ env.GIT_COMMIT_COMMITTER_EMAIL }}"
          commit_author: "${{ env.GIT_COMMIT_AUTHOR }}"
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Learn more about the drawio-export docker image.

GitHub logo rlespinasse / drawio-export

Export Draw.io diagrams using docker

Contributions welcome

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (1)

Collapse
 
_2082ca7cc65434467c4fb profile image
袁官东

If you need to design 3D software architecture diagram, you can try iCraft Editor : icraft.gantcloud.com/editor

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay