j40-cejst-2/.github/workflows/compile_mermaid.yml
Vim eb03d6cb5f
Fix broken YML links and add PR template (#1340)
* Fix MD files with broken links

- fixing all broken links
- all YML files are now in capital case

* Add PR template

* remove comments
2022-02-25 11:39:38 -08:00

52 lines
1.3 KiB
YAML

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/compile-mermaid-markdown-action@0.3.1
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 "action@github.com"
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 }}