https://github.com/emepetres/html-minifier-action
Action to use html-minifier on Github Actions
https://github.com/emepetres/html-minifier-action
deployment minify minify-html
Last synced: 8 months ago
JSON representation
Action to use html-minifier on Github Actions
- Host: GitHub
- URL: https://github.com/emepetres/html-minifier-action
- Owner: emepetres
- License: mit
- Created: 2024-03-08T18:58:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T23:54:27.000Z (over 2 years ago)
- Last Synced: 2025-05-30T13:02:39.439Z (about 1 year ago)
- Topics: deployment, minify, minify-html
- Language: JavaScript
- Homepage:
- Size: 1.89 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# HTMLMinifier Action
[](https://gitHub.com/emepetres/html-minifier-action/releases/)
[](https://github.com/emepetres/html-minifier-action/blob/main/LICENSE)
[](http://makeapullrequest.com)
Action to use [HTMLMinifier](https://github.com/kangax/html-minifier) on Github Actions
## Usage
Add the following step to your workflow file, just before deploying your HTML files.
```yaml
- uses: emepetres/html-minifier-action@v1
```
## Inputs
### `rootDir`
**Optional** Path to root directory containing HTML files. Default `"."`.
### `verbose`
**Optional** Prints minification details. Default `false`.
### `minifyCSS`
**Optional** Minify CSS in style elements and style attributes. Default `true`.
### `minifyJS`
**Optional** Minify JavaScript in script elements and event attributes. Default `true`.
### `flags`
**Optional** Additional flags to pass to HTMLMinifier, separted by comma. See [docs](https://github.com/kangax/html-minifier#options-quick-reference). Use ! to indicate false value of a flag..
## Outputs
### `minifiedFiles`
The files minified, relative to repository root.
## Example usage
```yaml
- name: HTMLMinifier
uses: emepetres/html-minifier-action@v1
id: html-minifier
with:
rootDir: "src"
verbose: true
flags: "collapseWhitespace, removeComments, removeOptionalTags, removeRedundantAttributes, removeScriptTypeAttributes, removeTagWhitespace, useShortDoctype, removeAttributeQuotes"
- name: Get the minfied files from output
run: echo "The files minfied are ${{ steps.html-minifier.outputs.minifiedFiles }}"
```