mdpage 0.1.3

Simple documentation tool
Documentation
name: docs

on:
    push:
      branches:
      - master
      paths:
      - '.github/workflows/build.yml'
      - '.github/workflows/docs.yml'
      - 'docs/*.sh'
      - 'docs/*.md'
      - 'docs/*/*.md'
      - 'docs/*/*/*.md'
      - 'docs/*/*/*/*.md'
      - 'docs/*/*/*/*/*.md'

jobs:
  build:
    env:
        RUST_LOG: info
        
    runs-on: ubuntu-latest

    steps:
    - name: Add cargo to path
      run: echo "::add-path::/home/runner/.cargo/bin/"
    
    - name: Install mdpage
      run: cargo install mdpage
    
    - name: Build
      shell: bash
      run: |
        mdpage ./docs/examples/basic
        mdpage ./docs/examples/sections
        mdpage ./docs/examples/full_page --full-page --title "Full Page" --subtitle "Full page example"
        mdpage ./docs/examples/config
        mdpage ./docs/examples/single_index --title "Single page" --subtitle "Single main page"
        mdpage ./docs/examples/single_page --title "Single page" --subtitle "Single content page"
        mdpage ./docs/examples/config_dir
        mdpage ./docs
    
    - name: Commit to repository
      env:
        GITHUB_TOKEN: ${{ secrets.DOCS_ACTION_TOKEN }}
        COMMIT_MSG: Update documentation
      run: |
        git config user.email "dbojan@gmail.com"
        git config user.name "Bojan"
        # Update origin with token
        git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
        # Checkout the branch so we can push back to it
        git checkout master
        git add .
        # Only commit and push if we have changes
        git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin master)