test drone-cache
continuous-integration/drone/push Build encountered an error Details

main
InkSoul 2023-08-12 10:12:53 +08:00
parent a368cf3d9f
commit 4ea098dca8
1 changed files with 21 additions and 3 deletions

View File

@ -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
path: blog_path
- name: cache
path: .git