kind: pipeline
type: docker
name: default

steps:
  - name: build
    image: node:16.18.0
    commands:
      - npm config set registry http://registry.npm.taobao.org
      - npm install
      - npm run build_test
  - name: develop deploy
    image: appleboy/drone-scp
    settings:
      host:
        from_secret: host
      port:
        from_secret: port
      username:
        from_secret: username
      password:
        from_secret: password
      target: /data/ls_rebuild/web
      source: ./dist
      rm: true
    when:
      branch:
        - main
  - name: notification
    image: lddsb/drone-dingtalk-message
    settings:
      token: 840fed65878154561a096c03a516ded894ab1b91efbe1643fe492dd93593e7a3
      type: markdown
      secret: SEC9fe40cc775658cbef7a30b43fd852b642201754f15df42cd339627e05cfde41e
      tpl: ./drone/index.md
      tips_title: 丽水二期web构建
      success_pic: https://i.ibb.co/CB4HBLP/success-1.png
      failure_pic: https://i.ibb.co/wM2rbGS/fail-1.png
trigger:
  branch:
    - main
