first
This commit is contained in:
		
							
								
								
									
										20
									
								
								action.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								action.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					name: "update docker image on swarm"
 | 
				
			||||||
 | 
					description: "update docker image on swarm"
 | 
				
			||||||
 | 
					inputs:
 | 
				
			||||||
 | 
					  docker:
 | 
				
			||||||
 | 
					    description: "DOCKER_HOST地址"
 | 
				
			||||||
 | 
					    required: true
 | 
				
			||||||
 | 
					    default: tcp://n1.coce.zone:2375
 | 
				
			||||||
 | 
					  service:
 | 
				
			||||||
 | 
					    description: "SERVICE名称"
 | 
				
			||||||
 | 
					    required: true
 | 
				
			||||||
 | 
					runs:
 | 
				
			||||||
 | 
					  using: "composite"
 | 
				
			||||||
 | 
					  steps:
 | 
				
			||||||
 | 
					    - uses: docker://docker:cli
 | 
				
			||||||
 | 
					      env:
 | 
				
			||||||
 | 
					        DOCKER_HOST: ${{ inputs.docker }}
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        entrypoint: "/bin/bash"
 | 
				
			||||||
 | 
					        args: |
 | 
				
			||||||
 | 
					          -c 'docker login ${{vars.DOCKER_REGISTRY}} -u ${{vars.DOCKER_USER}} -p ${{vars.DOCKER_PASS}} && docker service update {{inputs.service}} -d --with-registry-auth --image ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}'
 | 
				
			||||||
		Reference in New Issue
	
	Block a user