Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a25175e · Oct 28, 2021

History

17 Commits
Oct 28, 2021
Feb 9, 2021
Oct 28, 2021
Feb 9, 2021
Oct 28, 2021
Feb 7, 2021
Nov 1, 2020
Oct 28, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021

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

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

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

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

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

CircleCI

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

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%