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
|
image: node:latest
|
||||||
|
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
cache:
|
cache: # add cache to 'node_modules' for speeding up builds
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/ # Node modules and dependencies
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm install hexo-cli -g
|
- npm install hexo-cli -g
|
||||||
- npm install
|
- 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:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public # deploy to the 'public' folder
|
||||||
only:
|
only:
|
||||||
- master
|
- master # this job will affect only the 'master' branch
|
||||||
|
|
Loading…
Reference in New Issue