Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

devatherock/minify-js

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

CircleCI Version Codacy Badge Docker Pulls Docker Image Size License: MIT

Minify-JS Github Action/CI Plugin

Github action/CI Plugin to minify html, javascript and css files, using minify.

Usage

Github Action

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

  • inclusions - Multi-line string, each line of which contains a regex representing files/paths within the input directory to include/minify. By default, all files in the input directory will be minified

  • exclusions - Multi-line string, each line of which contains a regex representing files to exclude from minification. By default, no file in the input directory will be excluded

jobs:
 build:
 runs-on: ubuntu-latest # Docker-based github actions have to run on a linux environment
 steps:
 - name: Checkout
 uses: actions/checkout@v4
 - name: HTML/CSS/JS Minifier
 uses: docker://devatherock/minify-js:3.1.0
 with:
 directory: 'src' # Optional
 output: 'minify/src' # Optional
 add_suffix: false # Optional
 inclusions: |- # Optional
 .*assets.*
 .*static/index.html
 exclusions: |- # Optional
 .*assets/generated/.*

Docker

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 \
 -e PARAMETER_INCLUSIONS=".*assets.*\n.*static/index.html" \
 -e PARAMETER_EXCLUSIONS=".*assets/generated/.*" \
 devatherock/minify-js:3.1.0

vela

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

  • inclusions - Multi-line string, each line of which contains a regex representing files to include/minify. By default, all files in the input directory will be minified

  • exclusions - Multi-line string, each line of which contains a regex representing files to exclude from minification. By default, no file in the input directory will be excluded

steps:
 - name: minify_js
 ruleset:
 branch: master
 event: push
 image: devatherock/minify-js:3.1.0
 parameters:
 input_path: src
 output_path: minify/src
 add_suffix: false
 inclusions: |-
 .*assets.*
 .*static/index.html
 exclusions: |-
 .*assets/generated/.* 

CircleCI

version: 2.1
jobs:
 minify_js:
 docker:
 - image: devatherock/minify-js:3.1.0
 working_directory: ~/my-repo
 environment:
 PARAMETER_INPUT_PATH: src
 PARAMETER_OUTPUT_PATH: minify/src
 PARAMETER_ADD_SUFFIX: false
 PARAMETER_INCLUSIONS: '.*assets.*\n.*static/index.html'
 PARAMETER_EXCLUSIONS: '.*assets/generated/.*'
 steps:
 - checkout
 - run: node /app/bin/cli.mjs

Tests

To test the latest plugin image, run the below command

./gradlew test

Packages

No packages published

Languages

  • Groovy 70.6%
  • JavaScript 25.9%
  • Makefile 1.1%
  • Other 2.4%

AltStyle によって変換されたページ (->オリジナル) /