53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
kind: pipeline 
 | 
						|
type: docker 
 | 
						|
name: blog-publish 
 | 
						|
 | 
						|
clone:
 | 
						|
  disable: true # 启用代码拉取
 | 
						|
  depth: 1
 | 
						|
 | 
						|
steps: 
 | 
						|
  - 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
 | 
						|
 | 
						|
 | 
						|
  - name: build  
 | 
						|
    image: inksoul/hugo-rsync
 | 
						|
    #depends_on: [clone] # 依赖的步骤,
 | 
						|
    volumes:  #挂载数据卷
 | 
						|
      - name: blog         
 | 
						|
        path: /data     
 | 
						|
    commands:       
 | 
						|
      - hugo       
 | 
						|
      - rsync -a --delete --exclude '.user.ini' public/ /data
 | 
						|
 | 
						|
  - 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
 | 
						|
 | 
						|
volumes: #声明数据卷
 | 
						|
  - name: blog
 | 
						|
    host:
 | 
						|
      path: /home/ubuntu/myWork/Blog/InkSoul/public
 | 
						|
  - name: cache
 | 
						|
    host:
 | 
						|
      path: /home/ubuntu/myWork/blogCachePath |