main: push: #导入环境变量:https://docs.cnb.cool/zh/env.html#dao-ru-huan-jing-bian-liang - imports: - https://cnb.cool/examples/secrets/-/blob/main/react-ssh-secret.yml #声明构建环境:https://docs.cnb.cool/zh/ docker: image: node:20 #volumes缓存:https://docs.cnb.cool/zh/grammar/pipeline.html#volumes volumes: # 使用缓存,同时更新 - /root/.npm:cow stages: - name: 编译 script: npm install && npm run build - name: 查看目录 script: ls -a # https://docs.cnb.cool/zh/plugins/public/open-source/scp/scp # 使用插件将文件上传到服务器 # - name: 使用SCP插件:账号密码 # # 想查看更多插件及其用法请移步,【插件市场】https://ci.coding.net/docs/plugins/index.html # image: appleboy/drone-scp # settings: # # 环境变量用法参考,【环境变量】https://ci.coding.net/docs/env.html # host: $REMOTE_HOST # username: $REMOTE_USERNAME # password: $REMOTE_PASSWORD # port: $REMOTE_PORT # target: /opt # source: ./build - name: 使用SCP插件:私钥 # 想查看更多插件及其用法请移步,【插件市场】https://ci.coding.net/docs/plugins/index.html image: appleboy/drone-scp settings: # 环境变量用法参考,【环境变量】https://ci.coding.net/docs/env.html host: $REMOTE_HOST key: $PRIVATE_KEY port: $REMOTE_PORT target: /opt source: ./build