AutoDispatching/.drone.yml
2024-03-24 13:40:02 +08:00

47 lines
1.3 KiB
YAML

kind: pipeline
type: docker
name: autoDispatchDeploy
steps:
# 项目打包并发布
- name: autoDispatchBuild
pull: if-not-exists
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- cd AutoDispathingWork
- dotnet publish -c Release -o ../release
- name: push
image: plugins/docker
pull: if-not-exists
depends_on: [ autoDispatchBuild ]
settings:
dockerfile: ./AutoDispathingWork/Dockerfile
username:
from_secret: local_registry_username
password:
from_secret: local_registry_password
tags:
- latest
registry: 192.168.100.10:5000
insecure: true
repo: 192.168.100.10:5000/autodispatch/web
- name: deploy
image: appleboy/drone-ssh
depends_on: [ autoDispatchBuild,push ]
settings:
host:
from_secret: server_host
user:
from_secret: server_username
password:
from_secret: server_password
port: 22
command_timeout: 10m
script:
- docker stop autodispatch
- docker rm autodispatch
- docker rmi 24.233.2.182:5000/autodispatch/web
- docker pull 24.233.2.182:5000/autodispatch/web
- docker run -d --name autodispatch -p 88:8080 -v /root/Dispathing/Dispathing.db:/app/Dispathing.db 24.233.2.182:5000/autodispatch/web