From 9351f5179751586019cb772c11b86dd235a5511c Mon Sep 17 00:00:00 2001 From: Lena-hal Date: Thu, 21 Mar 2024 09:58:47 +0100 Subject: [PATCH] another fix --- .github/workflows/convert.yml | 37 +++++++++++++++++++++++++++++++++ .github/workflows/converter.yml | 21 ------------------- Dockerfile | 7 ------- _config.yml | 1 - action.yml | 24 --------------------- 5 files changed, 37 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/convert.yml delete mode 100644 .github/workflows/converter.yml delete mode 100644 Dockerfile delete mode 100644 _config.yml delete mode 100644 action.yml diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml new file mode 100644 index 0000000..9020755 --- /dev/null +++ b/.github/workflows/convert.yml @@ -0,0 +1,37 @@ +name: Convert Drawio to Image + +on: + [push] + workflow_dispatch: + +jobs: + Convert: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download DrawIO + run: | + sudo snap install drawio + + - name: Convert to Image + run: | + drawio -x -f png -o Diagram.png src/moucnik_diagram.drawio + + - name: Commit + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + COMMIT_MSG: | + Convert Image + run: | + git config user.email "actions@github" + git config user.name "Github Actions" + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + git add . + git pull origin ${GITHUB_REF} + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) \ No newline at end of file diff --git a/.github/workflows/converter.yml b/.github/workflows/converter.yml deleted file mode 100644 index b5c0f60..0000000 --- a/.github/workflows/converter.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Convert Drawio to Image - -on: [push] - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Convert diagram file to png image - uses: ./ - with: - quality: 100 - scale: 1.0 - src: src/moucnik_diagram.drawio - dest: diagram.png - - name: Upload images as artifacts - uses: actions/upload-artifact@v1 - with: - name: png - path: test.png \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ed553b6..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM burnett0/alpine-drawio-batch - -ENTRYPOINT ["sh", "-c", \ -"drawio-batch \ ---quality ${INPUT_QUALITY} \ ---scale ${INPUT_SCALE} \ -${INPUT_SRC} ${INPUT_DEST}"] diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 2f7efbe..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-minimal \ No newline at end of file diff --git a/action.yml b/action.yml deleted file mode 100644 index 2194afe..0000000 --- a/action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: 'actions-drawio' -author: 'Burnett01' -description: 'Convert draw.io documents to jpeg|png|svg|pdf.' -inputs: - quality: - description: 'Image quality for png|jpeg' - required: false - default: '100' - scale: - description: 'Scales the output file size for pixel-based output formats' - required: false - default: '1.0' - src: - description: 'Input file' - required: true - dest: - description: 'Output file' - required: true -runs: - using: 'docker' - image: 'Dockerfile' -branding: - icon: 'image' - color: 'gray-dark'