From 4ea098dca8ce3028dde28b541c4e819c591dc5e0 Mon Sep 17 00:00:00 2001 From: InkSoul Date: Sat, 12 Aug 2023 10:12:53 +0800 Subject: [PATCH] test drone-cache --- hugobuild.drone.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/hugobuild.drone.yml b/hugobuild.drone.yml index f6d53bd..2f4c19a 100644 --- a/hugobuild.drone.yml +++ b/hugobuild.drone.yml @@ -3,12 +3,22 @@ type: docker name: blog-publish clone: - disable: false # 启用代码拉取 + disable: true # 启用代码拉取 + steps: + - name: check_cache + image: alpine/git + commands: + - if [ -d ".git" ]; then + echo "Cache exists" + git pull + else + git clone https://gitea.inksoul.top/inksoul/InkSoul.git/ + fi + - name: build image: inksoul/hugo-rsync - depends_on: [clone] # 依赖的步骤, volumes: #挂载数据卷 - name: blog path: /data @@ -16,7 +26,15 @@ steps: - hugo - rsync -a --delete --exclude '.user.ini' public/ /data + - name: save_cache + image: drillster/drone-volume-cache + settings: + cache_to: + - .git + volumes: #声明数据卷 - name: blog host: - path: /home/ubuntu/myWork/Blog/InkSoul/public \ No newline at end of file + path: blog_path + - name: cache + path: .git \ No newline at end of file