Files
jianxinandClaude Opus 4.8 20e20daafc
ci/woodpecker/push/woodpecker Pipeline was successful
ci: pull base image from self-hosted registry (avoid docker hub)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 22:00:53 +08:00

73 lines
1.8 KiB
YAML

when:
- event: push
branch:
include:
- main
- feature/*
steps:
- name: build
image: woodpeckerci/plugin-docker-buildx
# 把 registry 域名指到宿主机内网 IP, 推送走内网不绕公网
backend_options:
docker:
extra_hosts:
- "registry.woni.link:172.19.152.186"
settings:
registry: registry.woni.link
username:
from_secret: registry_username
password:
from_secret: registry_password
repo: registry.woni.link/woni/office-xbot-feishu
tags: latest
dockerfile: ./Dockerfile
platforms: linux/amd64
# 注册表层缓存: requirements 未变时直接命中, 重建很快
cache_images:
- registry.woni.link/woni/office-xbot-feishu:cache
- name: scp
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
key:
from_secret: ssh_key
tags: 0.1
target: /home/docker/office-xbot-feishu
source: ./docker-compose.yaml
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
key:
from_secret: ssh_key
script:
- cd /home/docker/office-xbot-feishu
- docker compose down
- docker compose rm -f
- docker compose pull
- docker compose --env-file .env up -d
- name: feishu
image: curlimages/curl:8.8.0
commands:
- >
curl -fsS -X POST "$FEISHU_WEBHOOK"
-H 'Content-Type: application/json'
-d '{"msg_type":"text","content":{"text":"部署成功"}}'
environment:
FEISHU_WEBHOOK:
from_secret: feishu_webhook
when:
- status: [failure, success]