leo/.github/workflows/markdown.yml
2020-06-13 18:10:42 -07:00

43 lines
1.0 KiB
YAML

name: Markdown Compiler
on:
push:
paths:
- '**/*.md'
jobs:
build:
name: Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 '.*\.md$' | xargs)"
- name: MD files changed
run: echo ${{ steps.getfile.outputs.files }}
- name: Compile mermaid
uses: neenjaw/compile-mermaid-markdown-action@master
with:
files: ${{ steps.getfile.outputs.files }}
output: '.resources'
env:
HIDE_CODEBLOCKS: 1
- 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 commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}