更新 .drone.yml
Some checks reported errors
continuous-integration/drone/push Build is running
continuous-integration/drone Build was killed

This commit is contained in:
罗佳鸿 2024-08-12 02:20:34 +00:00
parent 7a08085a57
commit c6df4cb231

View File

@ -3,34 +3,30 @@ type: docker
name: vuepress-build
steps:
- name: install-dependencies
image: node:20.16.0 # 使用 Node.js 镜像来安装依赖
- name: install-and-build
image: node:20.16.0
commands:
- npm install # 安装项目依赖
- name: build
image: node:20.16.0 # 使用 Node.js 镜像来构建项目
commands:
- npm run build # 构建 VuePress 项目
- chmod +x ./run.sh # 确保脚本是可执行的
- ./run.sh # 执行构建脚本
- name: deploy
image: plugins/rsync # 使用 rsync 插件进行部署(可以根据需要选择其他插件)
image: plugins/rsync
settings:
remote: 8.219.93.84 # 远程服务器地址
username: 15185626476 # 使用环境变量定义远程用户
password: LJH@123456 # 使用环境变量定义远程密码
source: ./docs/.vuepress/dist # 构建输出目录
target: /path/to/remote/deploy/directory # 远程目标目录
remote: 8.219.93.84
username: 15185626476
password: LJH@123456
source: ./docs/.vuepress/dist
target: /path/to/remote/deploy/directory
when:
branch: main # 仅在 master 分支上部署
branch: main # 仅在 main 分支上部署
volumes:
- name: npm-cache
host:
path: /home/data/npm/cache # 缓存 npm 依赖
path: /home/data/npm/cache # 缓存 npm 依赖
services:
- name: docker
image: docker:26.1.3
commands:
- docker info
- docker info