Minify HTML in build pipeline.
This commit is contained in:
parent
6ef8329fdf
commit
88db2b24d6
1 changed files with 5 additions and 1 deletions
|
|
@ -50,13 +50,17 @@ jobs:
|
|||
name: Compile CSS
|
||||
run: pnpm run build
|
||||
-
|
||||
name: Append version as query arg to asset URLs
|
||||
name: Append version query arg to asset URLs
|
||||
env:
|
||||
VERSION: ${{ steps.metadata.outputs.VERSION }}
|
||||
run: |
|
||||
echo "VERSION = $VERSION"
|
||||
find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.css\)\"/\"\1?v=$VERSION\"/g" {} +
|
||||
find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.js\)\"/\"\1?v=$VERSION\"/g" {} +
|
||||
-
|
||||
name: Minify HTML
|
||||
run: |
|
||||
html-minifier-terser --collapse-whitespace --collapse-inline-tag-whitespace --minify-css --minify-js --remove-comments --input-dir public --output-dir public --file-ext html
|
||||
-
|
||||
name: Copy files to public folder
|
||||
run: mkdir -p /usr/share/nginx/static/fpv; cp -rf public/* /usr/share/nginx/static/fpv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue