/minify-action

Github Action to minify js, html, and css on push

Primary LanguageShellMIT LicenseMIT

Minify Action

GitHub release MIT license PRs Welcome

Github Action to minify js, css, and html files pushed to a branch, using the Minify package.

Usage

Here the target branch is foo. You need to checkout your repository so the Minify Action job can access it. Then, you can auto-commit the files to the repository if desired.

name: Minify Workflow
on:
  push:
    branches: [ foo ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}

      - name: Minify Action
        uses: anthonyftwang/minify-action@v1.0.1

      # Auto-commit to repository
      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Minify source code
          branch: ${{ github.ref }}