From 149e5df1b3ad4b736a61f9c4e92860ea0d9f5c73 Mon Sep 17 00:00:00 2001 From: lixin Date: Fri, 17 Jan 2025 11:35:25 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=87=8D=E6=9E=84=20Drone=20CI/CD=20?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=BA=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 --- .drone.yml | 60 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7463c78..3a19473 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,27 +1,41 @@ -kind: pipeline -type: docker -name: default +kind: pipeline +type: docker +name: deploy +# +volumes: + - name: node_modules + host: + path: /usr/local/blackend/node_modules + - name: web_build_dir + host: + path: /opt/1panel/apps/openresty/openresty/www/sites/120.48.5.80/index + - name: yarn_cache + host: + path: /usr/local/blackend/yarn_cache steps: - - name: build - image: plugins/docker - settings: - dockerfile: Dockerfile - dry_run: true - repo: automated-api - tags: - - latest - mirror: https://docker.1panelproxy.com - commands: - - docker run -d -p 8001:8001 --network tycm-server_test-network --name automated-api --restart unless-stopped automated-api:latest - - + - name: build-project + image: node:22-alpine + depends_on: [clone] + mirror: https://docker.1panelproxy.com + volumes: + - name: node_modules + path: /drone/src/node_modules + - name: web_build_dir + path: /drone/src/dist + - name: yarn_cache + path: /usr/local/share/.cache/yarn/v6 + commands: + # - npm config set registry https://registry.npm.taobao.org + - pnpm config set registry https://registry.npmmirror.com + - pnpm install + - pnpm build + #- npm cache clean --force + # - npm install + # - npm run build:prod + trigger: branch: - - main - - master - -volumes: - - name: docker - host: - path: /var/run/docker.sock \ No newline at end of file + - main + event: + - push \ No newline at end of file