Github action/CI Plugin to minify html, javascript and css files, using minify.
The following parameters can be set to configure the action.
-
directory - File to minify or a folder containing files to minify. By default, all files in current folder and its sub-folders will be minified
-
output - Path where the minified files will be saved. By default, the minified files will be saved in the original file path
-
add_suffix - Indicates if the output files should have the suffix
.min
added after the name. Default is true
jobs:
build:
runs-on: ubuntu-latest # Docker-based github actions have to run on a linux environment
steps:
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:1.0.2
with:
directory: 'src' # Optional
output: 'minify/src' # Optional
add_suffix: false # Optional
docker run --rm \
-v "/path/to/files":/work \
-w=/work \
-e PARAMETER_INPUT_PATH=/work/src \
-e PARAMETER_OUTPUT_PATH=/work/minify/src \
-e PARAMETER_ADD_SUFFIX=false \
devatherock/minify-js:1.0.2
The following parameters can be set to configure the plugin.
-
input_path - File to minify or a folder containing files to minify. By default, all files in current folder and its sub-folders will be minified
-
output_path - Path where the minified files will be saved. By default, the minified files will be saved in the original file path
-
add_suffix - Indicates if the output files should have the suffix
.min
added after the name. Default is true
steps:
- name: minify_js
ruleset:
branch: master
event: push
image: devatherock/minify-js:1.0.2
parameters:
input_path: src
output_path: minify/src
add_suffix: false
version: 2.1
jobs:
minify_js:
docker:
- image: devatherock/minify-js:1.0.2
working_directory: ~/my-repo
environment:
PARAMETER_INPUT_PATH: src
PARAMETER_OUTPUT_PATH: minify/src
PARAMETER_ADD_SUFFIX: false
steps:
- checkout
- run: sh /entrypoint.sh
To test the latest plugin image, run the below command
./gradlew test