kind: pipeline type: docker name: blog-publish clone: disable: true # 启用代码拉取 steps: - name: check_cache image: alpine/git commands: - if [ -d ".git" ]; then echo "Cache exists,pulling newer commit" git pull else echo "Cache not exists,cloning" git clone https://gitea.inksoul.top/inksoul/InkSoul.git; fi - name: build image: inksoul/hugo-rsync volumes: #挂载数据卷 - name: blog path: /data commands: - hugo - rsync -a --delete --exclude '.user.ini' public/ /data - name: save_cache image: drillster/drone-volume-cache settings: cache_to: - .git volumes: - name: cache path: .git volumes: #声明数据卷 - name: blog host: path: ~/myWork/Blog/InkSoul/public - name: cache host: path: ~/myWork/blogCachePath