From 5e4bb8596051269440f33373af416aacbc0a42bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E4=BD=B3=E9=B8=BF?= <2446434034@qq.com> Date: Mon, 12 Aug 2024 14:25:08 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index ac89ef5..93c3619 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,10 +1,28 @@ -kind: pipeline # kind 属性定义了对象的种类。此示例定义了一个管道对象。 -type: docker # type 属性定义管道的类型。此示例定义了一个 Docker 管道,其中每个管道步骤都在 Docker 容器内执行。 -name: default # name 属性定义了管道的名称。您可以为您的项目定义一个或多个管道 +kind: pipeline +type: docker +name: build-and-run -steps: # 步骤部分定义了一系列串行执行的管道步骤。如果管道中的任何步骤失败,管道将立即退出 - - name: greeting # name 属性定义管道步骤的名称 - image: alpine # image 属性定义了一个执行 shell 命令的 Docker 镜像。可以使用来自任何 DockerHub 中的任何 Docker镜像。 - commands: # commands 属性将在 Docker 容器内执行的 shell 命令列表定义为容器入口点。如果任何命令返回非零退出代码,则管道步骤将失败。 - - echo hello - - echo world \ No newline at end of file +steps: + - name: build-project + image: node:16.15.1 + volumes: + - name: node_modules + path: /drone/src/node_modules + commands: + - pwd + - ls -alt + - npm config set registry https://registry.npm.taobao.org + - npm install + - npm run build + + - name: run-vuepress + image: node:16.15.1 + volumes: + - name: node_modules + path: /drone/src/node_modules + - name: vuepress_output + path: /drone/src/.vuepress/dist + commands: + - cd /drone/src + - npm install -g vuepress + - npm run dev \ No newline at end of file