This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
Github Action: Auto Minified JS and CSS files #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: minifyJS | |
on: | |
push: | |
branches: [master] | |
jobs: | |
minify: | |
runs-on: ubuntu-latest | |
environment: masterAutoPush | |
if: github.ref == 'refs/heads/master' | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so auto-minify job can access it | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Auto Minify | |
uses: nizarmah/auto-minify@v2.1 | |
with: | |
overwrite: true | |
# Auto commits minified content to the existing files | |
# Ignore it if you don't want to commit the files to the repository | |
- name: Auto committing minified files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Github Action: Auto Minified JS and CSS files" | |
branch: ${{ github.ref }} |