live-forum/.drone.yml
zpc 03ff972d58
Some checks failed
continuous-integration/drone/push Build is failing
build
2026-03-24 14:23:10 +08:00

83 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
kind: pipeline
type: docker
name: live-forum
# 触发条件master 分支的 push 事件
trigger:
branch:
- master
event:
- push
steps:
# 步骤1构建小程序 WebAPI 镜像
- name: build-webapi
image: plugins/docker
settings:
registry: 192.168.195.25:19900
repo: 192.168.195.25:19900/live-forum/webapi
dockerfile: server/webapi/LiveForum/LiveForum.WebApi/Dockerfile
context: server/webapi/LiveForum
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: harbor_username
password:
from_secret: harbor_password
insecure: true
# 步骤2构建后台管理 API 镜像
- name: build-admin-api
image: plugins/docker
settings:
registry: 192.168.195.25:19900
repo: 192.168.195.25:19900/live-forum/admin-api
dockerfile: server/admin/ZrAdminNetCore/ZR.Admin.WebApi/Dockerfile
context: server/admin/ZrAdminNetCore
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: harbor_username
password:
from_secret: harbor_password
insecure: true
# 步骤3构建后台管理前端镜像
- name: build-admin-web
image: plugins/docker
settings:
registry: 192.168.195.25:19900
repo: 192.168.195.25:19900/live-forum/admin-web
dockerfile: server/admin/ZrAdminNetCore/ZR.Vue/Dockerfile
context: server/admin/ZrAdminNetCore/ZR.Vue
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: harbor_username
password:
from_secret: harbor_password
insecure: true
# 步骤4SSH 部署(等待三个构建步骤完成)
- name: deploy
image: appleboy/drone-ssh
settings:
host: 192.168.195.15
username:
from_secret: ssh_username
password:
from_secret: ssh_password
port: 22
script:
- cd /disk/docker-compose/live-forum-new
- docker compose pull
- docker compose up -d
depends_on:
- build-webapi
- build-admin-api
- build-admin-web