build website: stage: build # requiring the environment of latest NodeJS version 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 - npm install hexo-renderer-pug # Install Butterfly pug - npm install hexo-renderer-stylus # Install stylus renderer deploy to website: stage: deploy image: node:latest before_script: - apt-get update -qy - apt-get install -y lftp - npm i -g hexo-cli - npm i script: - git config --global init.defaultBranch master - npm install -g hexo-cli # Install hexo itself - npm install # Install Hexo modules and dependencies - hexo clean # Hexo clean previous static site - lftp -u $FTP_USERNAME,$FTP_PASSWORD server281.web-hosting.com -e "mirror /home/$FTP_USERNAME/public_html/ -R -p site dev ; quit" - hexo deploy # Deploy hexo to domain only: - master # this job will affect only the 'master' branch