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/JS-CSS-Minifier@v1.3
# 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/git-auto-commit-action@v3.0.0
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/JS-CSS-Minifier@v1.3
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/git-auto-commit-action@v3.0.0
with:
repository: 'js'
commit_message: "Github Action: Auto Minified JS and CSS files"
branch: ${{ github.ref }}
Please note that the
outputwill be in the same directory asdirectorywhich here isjs. Therefore, we will need to updaterepositoryin 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/JS-CSS-Minifier@v1.3
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/git-auto-commit-action@v3.0.0
with:
repository: 'mini_js'
commit_message: "Github Action: Auto Minified JS and CSS files"
branch: ${{ github.ref }}
Please note that the
repositorywhen auto comitting has to matchoutputin auto minify