27 lines
765 B
YAML
27 lines
765 B
YAML
build website:
|
|
stage: build
|
|
# requiring the environment of NodeJS 4.2.2
|
|
image: node:latest
|
|
# add 'node_modules' to cache for speeding up builds
|
|
cache:
|
|
paths:
|
|
- node_modules/ # Node modules and dependencies
|
|
script:
|
|
- npm install -g hexo-cli # Install Hexo itself
|
|
- npm install # Install Hexo modules and dependencies
|
|
- hexo version
|
|
# the 'pages' job will deploy and build your site to the 'public' path
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
|
|
upload:
|
|
stage: deploy
|
|
script:
|
|
- hexo generate
|
|
- apt-get install lftp -y
|
|
- lftp -e "open server281.web-hosting.com; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose --delete local-folder/ public_html/; bye"
|
|
- hexo deploy
|
|
only:
|
|
- master
|