From c8a78aff5dcbc175ef86e08a82ec585769de5c99 Mon Sep 17 00:00:00 2001 From: tone Date: Sat, 20 Dec 2025 00:48:12 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8F=90=E4=BA=A4.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..98779c0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,46 @@ +kind: pipeline +type: docker +name: deploy to k3s + +trigger: + branch: + - master + event: + - push + +steps: + - name: setup docker + image: docker:dind + commands: + - docker login -u admin -p admin localhost:5000 + + - name: build backend + image: node:22-alpine + commands: + - npm install -g pnpm + - cd apps/backend + - pnpm install --frozen-lockfile + - docker build -t localhost:5000/backend:latest . + - docker push localhost:5000/backend:latest + + - name: build frontend + image: node:22-alpine + commands: + - npm install -g pnpm + - cd apps/frontend + - pnpm install --frozen-lockfile + - docker build --build-arg API_BASE=http://backend-service:3001 -t localhost:5000/frontend:latest . + - docker push localhost:5000/frontend:latest + + - name: deploy to k3s + image: rancher/kubectl + commands: + - kubectl rollout restart deployment/backend + - kubectl rollout restart deployment/frontend + +services: + - name: docker + image: docker:dind + privileged: true + environment: + DOCKER_TLS_CERTDIR: ""