41 lines
		
	
	
		
			709 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			709 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| kind: pipeline
 | |
| type: docker
 | |
| name: deploy
 | |
| 
 | |
| steps:
 | |
|   - name: restore-cache
 | |
|     image: drillster/drone-volume-cache
 | |
|     volumes:
 | |
|       - name: cache
 | |
|         path: /cache
 | |
|     settings:
 | |
|       restore: true
 | |
|       mount:
 | |
|         - ./node_modules
 | |
| 
 | |
|   - name: generate
 | |
|     image: node:14-alpine
 | |
|     commands:
 | |
|     - npm install
 | |
|     - npm install -g hexo
 | |
|     - hexo g
 | |
|   
 | |
|   - name: rebuild-cache
 | |
|     image: drillster/drone-volume-cache
 | |
|     volumes:
 | |
|       - name: cache
 | |
|         path: /cache
 | |
|     settings:
 | |
|       rebuild: true
 | |
|       mount:
 | |
|         - ./node_modules
 | |
|     #当对应条件的时候才会执行
 | |
|     when:
 | |
|       status:
 | |
|         - success
 | |
|         - failure
 | |
| 
 | |
| volumes:
 | |
|   - name: cache
 | |
|     host:
 | |
|       path: /tmp/cache |