Minifies JS and CSS code files using UglifyJS & CleanCSS
Input | Description | Required | Default Value |
---|---|---|---|
directory | Directory that contains the files you want to minify. | false | . ( current directory ) |
output | Directory that contains the minified files. | false | same as directory |
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so auto-minify job have the access to it
- uses: actions/checkout@v2
- name: JS-CSS-Minifier
uses: SinithH/[email protected]
# Auto commits minified files into the repository
# Ignore it if you don't want to commit the files to the repository
- name: Auto committing minified files
uses: stefanzweifel/[email protected]
with:
commit_message: "Github Action: Auto Minified JS and CSS files"
branch: ${{ github.ref }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so auto-minify job can access it
- uses: actions/checkout@v2
- name: JS-CSS-Minifier
uses: SinithH/[email protected]
with:
directory: 'js'
# Auto commits minified files to the repository
# Ignore it if you don't want to commit the files to the repository
- name: Auto committing minified files
uses: stefanzweifel/[email protected]
with:
repository: 'js'
commit_message: "Github Action: Auto Minified JS and CSS files"
branch: ${{ github.ref }}
Please note that the
output
will be in the same directory asdirectory
which here isjs
. Therefore, we will need to updaterepository
in auto committing to also matchdirectory
.
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so auto-minify job can access it
- uses: actions/checkout@v2
- name: JS-CSS-Minifier
uses: SinithH/[email protected]
with:
directory: 'js'
output: 'mini_js'
# Auto commits minified files to the repository
# Ignore it if you don't want to commit the files to the repository
- name: Auto committing minified files
uses: stefanzweifel/[email protected]
with:
repository: 'mini_js'
commit_message: "Github Action: Auto Minified JS and CSS files"
branch: ${{ github.ref }}
Please note that the
repository
when auto comitting has to matchoutput
in auto minify