HtmlToPdf/.drone.yml
zpc 0a1eb497bd ci: Add Drone CI/CD pipeline configuration and deployment documentation
- Add `.drone.yml` with Drone CI pipeline for automated Docker image building and deployment
- Configure multi-stage build process: build Docker images and push to Harbor registry, then deploy via SSH
- Add CI-CD deployment documentation with architecture overview, quick start guide, and configuration templates
- Include single-service and multi-service project templates for reference
- Update `src/Dockerfile` for CI/CD integration
- Enable automated deployment to staging server on master branch push events
2026-04-05 14:20:14 +08:00

46 lines
977 B
YAML

---
kind: pipeline
type: docker
name: htmltopdf
trigger:
branch:
- master
event:
- push
steps:
# ==================== 构建并推送镜像 ====================
- name: build
image: plugins/docker
settings:
registry: 192.168.195.25:19900
repo: 192.168.195.25:19900/htmltopdf/api
dockerfile: src/Dockerfile
context: src
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: harbor_username
password:
from_secret: harbor_password
insecure: true
# ==================== 部署到服务器 ====================
- 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/htmltopdf
- docker compose pull
- docker compose up -d
depends_on:
- build