forked from pure-admin/pure-admin-thin
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.drone.yml
77 lines (72 loc) · 1.74 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
kind: pipeline
name: goAdmin-前端
type: docker
clone:
depth: 1
steps:
- name: build-image-and-push
pull: if-not-exists
image: plugins/docker
settings:
storage_driver: vfs
tags:
- latest
- ${DRONE_BUILD_NUMBER}
insecure: true
use_cache: true
registry:
from_secret: harbor_address
repo:
from_secret: harbor_repo
username:
from_secret: harbor_user
password:
from_secret: harbor_pass
context: ./
dockerfile: ./Dockerfile
when:
status:
- success
- name: send telegram notification
image: appleboy/drone-telegram
pull: if-not-exists
when:
status:
- success
- failure
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_to
format: markdown
message: >
{{#success build.status}}
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{else}}
❌ Build #{{build.number}} of `{{repo.name}}` failed.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{/success}}
- name: deploy
image: alpine
pull: if-not-exists
commands:
- sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
- apk update
- apk --no-cache add curl
# portainer hook
# - curl -XPOST http://192.168.1.9:9000/api/stacks/webhooks/ba7ab0fd-c0b2-47f2-806d-3cfa416cf464
trigger:
branch:
- main
event:
- push