mirror of https://gitlab.com/curben/blog
Compress files when deploy site
https://docs.gitlab.com/ee/user/project/pages/introduction.html#serving-compressed-assets
This commit is contained in:
parent
e3b6dc8404
commit
5d013e97b3
|
@ -1,16 +1,19 @@
|
|||
# Use latest version of Node.js
|
||||
image: node:latest
|
||||
|
||||
|
||||
pages:
|
||||
cache:
|
||||
cache: # add cache to 'node_modules' for speeding up builds
|
||||
paths:
|
||||
- node_modules/
|
||||
- node_modules/ # Node modules and dependencies
|
||||
|
||||
script:
|
||||
- npm install hexo-cli -g
|
||||
- npm install
|
||||
- hexo deploy
|
||||
- hexo deploy # deploy the site
|
||||
- find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \; # Compress files
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
- public # deploy to the 'public' folder
|
||||
only:
|
||||
- master
|
||||
- master # this job will affect only the 'master' branch
|
||||
|
|
Loading…
Reference in New Issue