diff --git a/README.md b/README.md index d6c2b3e..b5ca71a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,33 @@ cache: - node_modules/ ``` +### Current GitLab CI +Here is the current GitLab CI that I am using in my `gitlab-ci.yml`. +```yaml +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 + script: + - hexo clean # Hexo clean previous static site + - hexo generate # Hexo generate Static Site + - hexo deploy + only: + - master # this job will affect only the 'master' branch +``` + ### GitLab-CI with lftp If I want GitLab CI/CD to deploy my website each time that I push to GitLab, I can use something called [lftp][lftp]. Here is what you can do in the `gitlab-ci.yml` configuration file.