Skip to content

Minifier your CSS and JS code files πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

License

Notifications You must be signed in to change notification settings

SinithH/JS-CSS-Minifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

auto-minify

Minifies JS and CSS code files using UglifyJS & CleanCSS

Inputs

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

Example

Default implementation of the action
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 }}
Specifying output directory
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 as directory which here is js. Therefore, we will need to update repository in auto committing to also match directory.

With different output directory
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 match output in auto minify

About

Minifier your CSS and JS code files πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published