kind: pipeline type: docker name: blog steps: # 使用缓存 - name: restore-cache image: drillster/drone-volume-cache settings: restore: true mount: - ./node_modules volumes: - name: node_cache path: /cache # 打包 - name: build-blog image: node:16-alpine commands: - npm install -g hexo-cli - npm install --registry https://registry.npm.taobao.org - hexo D # 更新缓存 - name: rebuild-cache image: drillster/drone-volume-cache settings: rebuild: true mount: - ./node_modules volumes: - name: node_cache path: /cache # 部署 - name: deploy-blog image: appleboy/drone-scp settings: host: 43.139.174.194 port: 22 username: root password: from_secret: ssh_key command_timeout: 3m # 设置要将打包户的文件部署到的文件地址 target: /mydata/blog source: ./public/* rm: true strip_components: 1 when: status: - success volumes: - name: node_cache host: path: /mydata/node