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
| kind: pipeline
| type: docker
| name: Build and Deploy
|
| clone:
| depth: 10
|
| volumes:
| - name: go_cache
| host:
| path: /data/drone_cache/go_cache
|
| steps:
| - name: restore-cache
| image: drillster/drone-volume-cache
| volumes:
| - name: go_cache
| path: /cache
| settings:
| restore: true
| mount:
| - ./.npm-cache
| - ./node_modules
|
| - name: build
| image: node:alpine
| pull: if-not-exists
| commands:
| - export NODE_OPTIONS=--max_old_space_size=6144
| - echo ${DRONE_BRANCH}
| - echo ${DRONE_TAG}
| - echo ${DRONE_COMMIT}
| - echo ${DRONE_COMMIT:0-7}
| - npm config set registry https://registry.npmmirror.com
| - npm install -g pnpm
| - pnpm config set registry https://registry.npmmirror.com
| - pnpm i
| - pnpm build
|
| - name: rebuild-cache
| image: drillster/drone-volume-cache
| volumes:
| - name: go_cache
| path: /cache
| settings:
| rebuild: true
| mount:
| - ./.npm-cache
| - ./node_modules
|
| - name: scp files
| image: appleboy/drone-scp
| pull: if-not-exists
| settings:
| host:
| from_secret: HOST
| username:
| from_secret: USERNAME
| password:
| from_secret: PASSWORD
| port:
| from_secret: PORT
| target:
| from_secret: TARGET_PATH
| source: dist/*
| overwrite: true
| rm: true
|
| trigger:
| branch:
| - master
| event:
| - push
|
|