-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.07 KB
/
convert.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
sudo apt-get update
sudo apt-get install -y xvfb
- name: Convert to Image
run: |
sudo rm -rf Diagram.png
xvfb-run drawio -x -f png -o Diagram.png 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})