doc: update gitlab-ci.yml

This commit is contained in:
Leon Xu committed 2021-08-27 00:19:47 -07:00
1 parent f8d3737297
commit 68f226c750
1 file changed
+17 -16
+17 -16
View File
@@ -1,24 +1,25 @@
# Using the latest of ubuntu image
image: ubuntu:latest
before_script:
- apt update -qy # Check for update
- apt install -y lftp # Install lftp
- apt install curl -y # Install curl
- curl -fsSL https://deb.nodesource.com/setup_current.x | bash
- apt install nodejs -y # Install NodeJS
- npm install -g hexo-cli # Install Hexo itself
- npm install # Install Hexo modules and dependencies
- npm install hexo-renderer-pug # Install Butterfly pug
- npm install hexo-renderer-stylus # Install stylus renderer
deploy via lftp:
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
before_script:
- npm install -g hexo-cli # Install Hexo itself
- npm install # Install Hexo modules and dependencies
- npm install hexo-renderer-pug # Install Butterfly pug
- npm install hexo-renderer-stylus # Install stylus renderer
# the 'pages' job will deploy and build your site to the 'public' path
deploy via site configuration:
stage: deploy
script:
- hexo clean # Hexo clean previous static site
- hexo generate # Hexo generate Static Site
- lftp -e "mirror -R public/ $FTP_REMOTE_PATH/" -u $FTP_USER,$FTP_PASS $FTP_HOST $FTP_PORT
- hexo deploy # Hexo deploy content
artifacts:
paths:
- public
only:
- master # this job will affect only the 'master' branch
- master # this job will affect only the 'master' branch