hejianhao
7 天以前 5c387bd3f785341fb0cbd638c61804ca6d77d6e1
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
---
kind: pipeline
name: datav
concurrency:
  limit: 1
steps:
  - name: restore-cache
    image: drillster/drone-volume-cache
    settings:
      restore: true
      cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
      mount:
        - ./node_modules
    volumes:
      - name: cache
        path: /cache
 
  - name: build-prod
    image: node:16.14.2
    commands:
      - node --version
      - git diff --name-only HEAD^ HEAD | grep package-lock.json && npm install  --registry https://registry.npmmirror.com/ --no-frozen-lockfile
      - "[ -d node_modules ] && echo 'deps install done' || npm install --registry https://registry.npmmirror.com/ --no-frozen-lockfile"
      - npm run build
    when:
      branch:
        - master
  - name: rebuild-cache
    image: drillster/drone-volume-cache
    settings:
      rebuild: true
      cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME]
      mount:
        - ./node_modules
    volumes:
      - name: cache
        path: /cache
 
  - name: deploy-prod
    image: drillster/drone-rsync
    settings:
      user: root
      port: 22
      hosts: [api.mdfitnesscao.com]
      source: ./dist/*
      target: /docker/www/datav
      include: []
      exclude: []
      key:
        from_secret: ssh_key
    when:
      branch:
        - master
volumes:
  - name: cache
    host:
      path: /tmp
 
trigger:
  branch:
    - master