-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
93 lines (80 loc) · 2.05 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
kind: pipeline
type: docker
name: default
clone:
depth: 1
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
x-docker-step: &docker-step
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
BUILD_TAG: ${DRONE_BRANCH}-${DRONE_COMMIT}
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
x-docker-auth:
- &docker-auth docker login docker.pkg.github.com -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
steps:
- name: Build docker image
<<: *docker-step
commands:
- docker build -t docker.pkg.github.com/zyra/zmdocs/zmdocs:$BUILD_TAG .
- name: Push docker image
<<: *docker-step
commands:
- *docker-auth
- docker push docker.pkg.github.com/zyra/zmdocs/zmdocs:$BUILD_TAG
- name: Push latest docker image
<<: *docker-step
when:
branch:
- master
commands:
- *docker-auth
- docker tag docker.pkg.github.com/zyra/zmdocs/zmdocs:$BUILD_TAG docker.pkg.github.com/zyra/zmdocs/zmdocs:latest
- docker push docker.pkg.github.com/zyra/zmdocs/zmdocs:latest
- name: Push version tagged image
<<: *docker-step
when:
event:
- tag
commands:
- *docker-auth
- docker tag docker.pkg.github.com/zyra/zmdocs/zmdocs:$BUILD_TAG docker.pkg.github.com/zyra/zmdocs/zmdocs:$DRONE_TAG
- docker push docker.pkg.github.com/zyra/zmdocs/zmdocs:$DRONE_TAG
- name: Build binaries
image: golang:1.12-alpine
when:
event:
- tag
commands:
- apk add git make
- make build -j$(nproc)
- name: Publish binaries to Github
image: plugins/github-release
when:
event:
- tag
settings:
api_key:
from_secret: github_secret
files:
- zmdocs_darwin_amd64
- zmdocs_linux_amd64
- zmdocs_windows_amd64.exe
checksum:
- md5
- sha1
- sha256
- sha512
---
kind: signature
hmac: c399e98d3ff1a3b273c3743447cb6e567eacbcdab9eb597cc94885c7ee82ed42
...