2023-08-08 16:50:33 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: blog-publish
|
|
|
|
|
2024-01-03 20:20:37 +08:00
|
|
|
clone:
|
|
|
|
disable: true # 启用代码拉取
|
|
|
|
depth: 1
|
2023-08-08 16:53:10 +08:00
|
|
|
|
2023-08-08 16:50:33 +08:00
|
|
|
steps:
|
2024-01-03 16:16:44 +08:00
|
|
|
- name: restore-cache
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
pull: true
|
|
|
|
settings:
|
|
|
|
backend: "filesystem"
|
|
|
|
restore: true
|
|
|
|
debug: true
|
|
|
|
cache_key: "volume"
|
|
|
|
archive_format: "gzip"
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /tmp/cache
|
|
|
|
|
|
|
|
|
2023-08-08 16:50:33 +08:00
|
|
|
- name: build
|
2023-08-08 16:53:10 +08:00
|
|
|
image: inksoul/hugo-rsync
|
2024-01-03 20:19:03 +08:00
|
|
|
#depends_on: [clone] # 依赖的步骤,
|
2023-08-08 16:53:10 +08:00
|
|
|
volumes: #挂载数据卷
|
2023-08-08 16:54:33 +08:00
|
|
|
- name: blog
|
|
|
|
path: /data
|
|
|
|
commands:
|
|
|
|
- hugo
|
|
|
|
- rsync -a --delete --exclude '.user.ini' public/ /data
|
2023-08-08 16:50:33 +08:00
|
|
|
|
2024-01-03 16:16:44 +08:00
|
|
|
- name: rebuild-cache
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
pull: true
|
|
|
|
settings:
|
|
|
|
backend: "filesystem"
|
|
|
|
rebuild: true
|
|
|
|
debug: true
|
|
|
|
cache_key: "volume"
|
|
|
|
archive_format: "gzip"
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /tmp/cache
|
|
|
|
|
2023-08-08 16:50:33 +08:00
|
|
|
volumes: #声明数据卷
|
|
|
|
- name: blog
|
|
|
|
host:
|
2024-01-03 16:16:44 +08:00
|
|
|
path: /home/ubuntu/myWork/Blog/InkSoul/public
|
|
|
|
- name: cache
|
|
|
|
host:
|
|
|
|
path: /home/ubuntu/myWork/blogCachePath
|