-
Notifications
You must be signed in to change notification settings - Fork 56
52 lines (43 loc) · 1.31 KB
/
compile_mermaid.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
41
42
43
44
45
46
47
48
49
50
51
52
name: 'Compile Mermaid to MD'
on:
push:
paths:
- 'docs/**/*.mmd'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get Changed Files
id: getfile
run: |
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -e '.*\.mmd$' | xargs)"
- name: Print mmd Files Changed
run: |
echo ${{ steps.getfile.outputs.files }}
- name: Compile Mermaid Files
uses: neenjaw/[email protected]
with:
files: ${{ steps.getfile.outputs.files }}
output: '.resources'
env:
HIDE_CODEBLOCKS: 1
ABSOLUTE_IMAGE_LINKS: 1
OUTPUT_FILE_TYPE: "svg"
- name: Show Changes
run: |
git status
- name: Commit Files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || git commit -a -m 'Updating Diagram'
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}