diff options
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7ca615e..456121d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,15 +117,19 @@ variables: - for i in `find public -name README.html`; do ln -sf README.html $(dirname $i)/index.html; done # Remove CE dir and symlink EE to CE - if [ $CI_PIPELINE_SOURCE != 'pipeline' ]; then cd public && rm -rf ce && ln -s ee ce && cd ../; fi - # Use gzip to compress content - - SIZE_BEFORE_GZIP=$(du -sh public/) - - find public/ -type f \( -iname "*.html" -o -iname "*.js" -o -iname "*.css" -o -iname "*.svg" \) -exec gzip --keep --best --force --verbose {} \; - - SIZE_AFTER_GZIP=$(du -sh public/) + # Calculate sizes before and after minifying/gzipping the static files (HTML, CSS, JS) + - SIZE_BEFORE=$(du -sh public/ | awk '{print $1}') # Minify the assets of the resulting site - ./scripts/minify-assets.sh ./ public/ - - SIZE_AFTER_MINIFY=$(du -sh public/) + - SIZE_AFTER_MINIFY=$(du -sh public/ | awk '{print $1}') + # Use gzip to compress static content for faster web serving + # https://docs.gitlab.com/ee/user/project/pages/introduction.html#serving-compressed-assets + - find public/ -type f \( -iname "*.html" -o -iname "*.js" -o -iname "*.css" -o -iname "*.svg" \) -exec gzip --keep --best --force --verbose {} \; + - SIZE_AFTER_GZIP=$(du -sh public/ | awk '{print $1}') # Print size results - - echo -e "Size before gzipping $SIZE_BEFORE_GZIP\nSize after gzipping $SIZE_AFTER_GZIP\nSize after minifying $SIZE_AFTER_MINIFY" + - echo "Minify and compress the static assets (HTML, CSS, JS)" + - echo + - echo -e "Size before minifying and gzipping ..... $SIZE_BEFORE\nSize after minifying ................... $SIZE_AFTER_MINIFY\nSize after adding gzipped versions ..... $SIZE_AFTER_GZIP" artifacts: paths: - public |