-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
75 lines (67 loc) · 1.44 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
kind: pipeline
name: Publish_to_NPM
type: docker
trigger:
event:
- tag
steps:
- name: publish
image: node:alpine
environment:
NPM_ACCESS_TOKEN:
from_secret: NPM_ACCESS_TOKEN
commands:
- npm set //registry.npmjs.org/:_authToken $NPM_ACCESS_TOKEN
- npm publish
---
kind: pipeline
name: Publish_to_DockerHub
type: docker
trigger:
event:
- tag
steps:
- name: prepare
image: docker:20
volumes:
- name: docker.sock
path: /var/run/docker.sock
commands:
- docker pull node:alpine
- name: build
image: docker:20
volumes:
- name: docker.sock
path: /var/run/docker.sock
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
commands:
- |
echo '
FROM node:alpine
RUN set -eux; \
npm install -g wol-helper; \
mkdir -p /usr/local/etc/wol-helper
CMD ["wol-helper", "/usr/local/etc/wol-helper/config.json"]
' | docker build -t $DOCKERHUB_USERNAME/wol-helper -
- name: push
image: docker:20
volumes:
- name: docker.sock
path: /var/run/docker.sock
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker push $DOCKERHUB_USERNAME/wol-helper
- docker rmi $DOCKERHUB_USERNAME/wol-helper
volumes:
- name: docker.sock
host:
path: /var/run/docker.sock
depends_on:
- Publish_to_NPM