更新 .drone.yml
Some checks failed
部署文档 / deploy-gh-pages (push) Waiting to run
continuous-integration/drone/push Build is failing

This commit is contained in:
罗佳鸿 2024-08-16 09:12:37 +00:00
parent 8e7b0c2410
commit 71d095efbc

View File

@ -11,6 +11,18 @@ volumes:
path: /var/lib/drone/vuepress_output
steps:
- name: install-dependencies
image: node:20.16.0
volumes:
- name: node_modules
path: /drone/src/node_modules
commands:
- pwd
- ls -alt
- npm config set registry https://registry.npmjs.org/ # 切换到官方 npm 镜像源
- npm cache clean --force # 清理缓存
- npm install
- name: build-vuepress
image: node:20.16.0
volumes:
@ -20,11 +32,11 @@ steps:
path: /drone/src/docs/.vuepress/dist
commands:
- cd /drone/src
- npm install
- npm install -g vuepress
- npm run docs:build
- name: deploy
image: alpine:latest
commands:
- apk add --no-cache rsync # Install rsync
- rsync -av --delete /drone/src/docs/.vuepress/dist/ /usr/share/nginx/html/
- rsync -av --delete /var/lib/drone/vuepress_output/ /usr/share/nginx/html/