# This is a basic workflow to help you get started with Actions

name: Auto Minify CSS/JS file

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the dev branch
on:
  push:
    paths:
      - 'public/assets/css/**'
      - 'public/assets/js/**'
      - 'public/theme/**'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.PAT }}
      - name: Auto Minify Tabler Theme CSS file
        uses: nizarmah/auto-minify@master
        with:
          directory: 'public/theme/tabler/css'
      - name: Auto Minify Tabler Theme JS file
        uses: nizarmah/auto-minify@master
        with:
          directory: 'public/theme/tabler/js'
      - name: Auto Minify CSS file
        uses: nizarmah/auto-minify@master
        with:
          directory: 'public/assets/css'
      - name: Auto Minify JS file
        uses: nizarmah/auto-minify@master
        with:
          directory: 'public/assets/js'
      - name: Auto committing minified files
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          repository: 'public'
          commit_message: "Github Action: Auto Minified Theme CSS/JS Files"
