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