kind: pipeline
type: docker
name: api2gpt-web

workspace:
  path: /drone/src

steps:
  - name: build
    image: node:16.15.0-slim
    commands:
    - yarn --registry=https://registry.npmmirror.com
    - yarn build:prod

  - name: sync-file
    image: drillster/drone-rsync
    settings:
      user: root
      key:
        from_secret: kelvin_ssh_key
      hosts: # 多个ip使用,隔开
        from_secret: kelvin_ssh_host
      # 来源目录
      source: ./dist/*
      # 目标服务器目录
      target: /data/wwwroot/api2gpt/web
      script:
        - echo "Deploy Success"
