Kaynağa Gözat

:gear: only deploy when activity detected on master

tags/1.0.2
J 3 yıl önce
ebeveyn
işleme
5aa2480123
1 değiştirilmiş dosya ile 57 ekleme ve 56 silme
  1. 57
    56
      .drone.yml

+ 57
- 56
.drone.yml Dosyayı Görüntüle

@@ -5,7 +5,6 @@
5 5
 
6 6
 # push_deploy_key: id_rsa from DRONE host machine
7 7
 
8
-
9 8
 ################
10 9
 # Build & Test #
11 10
 ################
@@ -14,43 +13,43 @@ kind: pipeline
14 13
 name: run_tests
15 14
 
16 15
 steps:
17
-# Test the vue theme
18
-- name: test
19
-  image: node
20
-  commands:
21
-  - pwd
22
-  - cd ./vue-theme
23
-  - npm install
24
-  - npm test
25
-  volumes:
26
-  # Link node_modules cache from host filesystem into container at the expected location
27
-  - name: node_cache
28
-    path: /drone/src/vue-theme/node_modules
16
+    # Test the vue theme
17
+    - name: test
18
+      image: node
19
+      commands:
20
+          - pwd
21
+          - cd ./vue-theme
22
+          - npm install
23
+          - npm test
24
+      volumes:
25
+          # Link node_modules cache from host filesystem into container at the expected location
26
+          - name: node_cache
27
+            path: /drone/src/vue-theme/node_modules
29 28
 
30
-- name: build
31
-  image: node
32
-  commands:
33
-  - cd ./vue-theme
34
-  - rm -Rf ./build/*
35
-  - npx browserslist@latest --update-db
36
-  - npm run build
37
-  - ls ./build
38
-  environment:
39
-    NODE_OPTIONS: --openssl-legacy-provider
40
-  volumes:
41
-    # Link node_modules cache from host filesystem into container at the expected location
42
-    - name: node_cache
43
-      path: /drone/src/vue-theme/node_modules
44 29
     - name: build
45
-      path: /drone/src/vue-theme/build
30
+      image: node
31
+      commands:
32
+          - cd ./vue-theme
33
+          - rm -Rf ./build/*
34
+          - npx browserslist@latest --update-db
35
+          - npm run build
36
+          - ls ./build
37
+      environment:
38
+          NODE_OPTIONS: --openssl-legacy-provider
39
+      volumes:
40
+          # Link node_modules cache from host filesystem into container at the expected location
41
+          - name: node_cache
42
+            path: /drone/src/vue-theme/node_modules
43
+          - name: build
44
+            path: /drone/src/vue-theme/build
46 45
 
47 46
 volumes:
48
-  - name: node_cache
49
-    host:
50
-      path: /tmp/cache/drone/node_modules
51
-  - name: build
52
-    host:
53
-      path: /tmp/cache/drone/build
47
+    - name: node_cache
48
+      host:
49
+          path: /tmp/cache/drone/node_modules
50
+    - name: build
51
+      host:
52
+          path: /tmp/cache/drone/build
54 53
 ---
55 54
 ########################
56 55
 # Deploy to Production #
@@ -59,30 +58,32 @@ volumes:
59 58
 kind: pipeline
60 59
 name: deploy
61 60
 depends_on:
62
-  # Must run after the first pipeline
63
-  - run_tests
61
+    # Must run after the first pipeline
62
+    - run_tests
64 63
 trigger:
65
-  status:
66
-    # Only runs if the first pipeline was fully successful
67
-    - success
64
+    status:
65
+        # Only runs if the first pipeline was fully successful
66
+        - success
67
+    branch:
68
+        - master
68 69
 
69 70
 steps:
70
-# post-receive hook
71
-- name: push commit
72
-  image: appleboy/drone-git-push:0.2.0-linux-amd64
73
-  settings:
74
-    branch: master
75
-    remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
76
-    remote_name: staging
77
-    force: true
78
-    ssh_key:
79
-      # !: id_rsa from DRONE machine
80
-      from_secret: push_deploy_key
71
+    # post-receive hook
72
+    - name: push commit
73
+      image: appleboy/drone-git-push:0.2.0-linux-amd64
74
+      settings:
75
+          branch: master
76
+          remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
77
+          remote_name: staging
78
+          force: true
79
+          ssh_key:
80
+              # !: id_rsa from DRONE machine
81
+              from_secret: push_deploy_key
81 82
 
82 83
 volumes:
83
-  - name: node_cache
84
-    host:
85
-      path: /tmp/cache/drone/node_modules
86
-  - name: build
87
-    host:
88
-      path: /tmp/cache/drone/build
84
+    - name: node_cache
85
+      host:
86
+          path: /tmp/cache/drone/node_modules
87
+    - name: build
88
+      host:
89
+          path: /tmp/cache/drone/build

Loading…
İptal
Kaydet