-
Notifications
You must be signed in to change notification settings - Fork 0
/
drone.yml
80 lines (69 loc) · 1.28 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
kind: pipeline
type: docker
name: build and deploy
volumes:
- name: cache
host:
path: /tmp/cache
steps:
- name: cache key
image: ubuntu
commands:
- echo -n $(md5sum package.json) > .cache_key
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
- name: build
image: klakegg/hugo:0.92.2-ext-ubuntu
environment:
HUGO_ENVIRONMENT: stage
commands:
- yarn install --frozen-lockfile
- yarn build
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
- name: webp
image: elswork/cwebp
commands:
- |
cd public
mkdir webp
for image in $(find -type f \( -name '*.jpeg' -o -name '*.jpg' -o -name '*.png' \)); do
echo "Convert $image"
mkdir -p "webp/$(dirname $image)"
cwebp "$image" -o "webp/$image.webp" 2>/dev/null;
done
cd ..
trigger:
event:
- push
---
kind: pipeline
type: docker
name: deploy
steps:
- name: build
image: node
environment:
HUGO_ENVIRONMENT: production
commands:
- yarn install --frozen-lockfile
- yarn build
trigger:
event:
- promote
target:
- production