|
@@ -0,0 +1,83 @@
|
|
1
|
+---
|
|
2
|
+kind: pipeline
|
|
3
|
+type: docker
|
|
4
|
+name: default
|
|
5
|
+
|
|
6
|
+steps:
|
|
7
|
+
|
|
8
|
+- name: restore cache
|
|
9
|
+ image: drillster/drone-volume-cache
|
|
10
|
+ settings:
|
|
11
|
+ restore: true
|
|
12
|
+ mount:
|
|
13
|
+ - ./node_modules
|
|
14
|
+ volumes:
|
|
15
|
+ - name: cache
|
|
16
|
+ path: /cache
|
|
17
|
+
|
|
18
|
+- name: npm install
|
|
19
|
+ image: node:12
|
|
20
|
+ commands:
|
|
21
|
+ - npm install
|
|
22
|
+
|
|
23
|
+- name: npm run build
|
|
24
|
+ image: node:12
|
|
25
|
+ commands:
|
|
26
|
+ - npm run build
|
|
27
|
+
|
|
28
|
+- name: rebuild cache
|
|
29
|
+ image: drillster/drone-volume-cache
|
|
30
|
+ settings:
|
|
31
|
+ rebuild: true
|
|
32
|
+ mount:
|
|
33
|
+ - ./node_modules
|
|
34
|
+ volumes:
|
|
35
|
+ - name: cache
|
|
36
|
+ path: /cache
|
|
37
|
+
|
|
38
|
+- name: npm run test
|
|
39
|
+ image: node:12
|
|
40
|
+ commands:
|
|
41
|
+ - npm run test
|
|
42
|
+
|
|
43
|
+- name: build docs
|
|
44
|
+ image: node:12
|
|
45
|
+ commands:
|
|
46
|
+ - npm run docs
|
|
47
|
+ when:
|
|
48
|
+ event:
|
|
49
|
+ - tag
|
|
50
|
+
|
|
51
|
+- name: deliver docs
|
|
52
|
+ image: node:12
|
|
53
|
+ commands:
|
|
54
|
+ - echo ${DRONE_BUILD_CREATED}
|
|
55
|
+ - git clone https://gitea.nitowa.xyz/docs/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../docs/* .; cp ../LICENSE.md .
|
|
56
|
+ - sed -i '1,3d; $d' README.md && echo "### Version\n\n${DRONE_TAG}\n" >> ./README.md
|
|
57
|
+ - sed -i -e 1,4d ./globals.md && cat ./globals.md >> ./README.md
|
|
58
|
+ - git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}"
|
|
59
|
+ - (git tag ${DRONE_TAG} && git push --force origin master ${DRONE_TAG}) || true
|
|
60
|
+ environment:
|
|
61
|
+ GIT_USER:
|
|
62
|
+ from_secret: git_user
|
|
63
|
+ GIT_PASSWORD:
|
|
64
|
+ from_secret: git_password
|
|
65
|
+ when:
|
|
66
|
+ event:
|
|
67
|
+ - tag
|
|
68
|
+
|
|
69
|
+- name: npm publish
|
|
70
|
+ image: plugins/npm
|
|
71
|
+ settings:
|
|
72
|
+ username: nitowa
|
|
73
|
+ password:
|
|
74
|
+ from_secret: npm_password
|
|
75
|
+ email: peter.millauer@gmail.com
|
|
76
|
+ when:
|
|
77
|
+ event:
|
|
78
|
+ - tag
|
|
79
|
+
|
|
80
|
+volumes:
|
|
81
|
+- name: cache
|
|
82
|
+ host:
|
|
83
|
+ path: /tmp
|