From 38b888d1c62c36b9f5c6ba18c4abe0fec31aaebe Mon Sep 17 00:00:00 2001 From: Leon Xu <6479451-leonxu260@users.noreply.gitlab.com> Date: Fri, 27 Aug 2021 00:19:47 -0700 Subject: [PATCH] doc: update gitlab-ci.yml --- .gitlab-ci.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d18474..c996b9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 \ No newline at end of file