doc: add current gitlab-ci.yml script that I am using

This commit is contained in:
Leon Xu committed 2021-08-27 12:04:57 -07:00
1 parent 37c03bfb3d
commit eb6d2065ba
1 file changed
+27
+27
View File
@@ -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.