mirror of
				https://gitea.com/docker/build-push-action.git
				synced 2025-10-31 00:58:18 +07:00 
			
		
		
		
	Merge pull request #196 from crazy-max/check-status
Check desired output status
This commit is contained in:
		
						commit
						c58c6870a2
					
				
							
								
								
									
										22
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,6 +1,7 @@ | |||||||
| name: ci | name: ci | ||||||
| 
 | 
 | ||||||
| on: | on: | ||||||
|  |   workflow_dispatch: | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|       - master |       - master | ||||||
| @ -211,6 +212,7 @@ jobs: | |||||||
|         uses: docker/setup-buildx-action@v1 |         uses: docker/setup-buildx-action@v1 | ||||||
|       - |       - | ||||||
|         name: Build |         name: Build | ||||||
|  |         id: docker_build | ||||||
|         continue-on-error: true |         continue-on-error: true | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
| @ -219,6 +221,14 @@ jobs: | |||||||
|           platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x |           platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x | ||||||
|           push: true |           push: true | ||||||
|           tags: localhost:5000/name/app:latest |           tags: localhost:5000/name/app:latest | ||||||
|  |       - | ||||||
|  |         name: Check | ||||||
|  |         run: | | ||||||
|  |           echo "${{ toJson(steps.docker_build) }}" | ||||||
|  |           if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then | ||||||
|  |             echo "::error::Should have failed" | ||||||
|  |             exit 1 | ||||||
|  |           fi | ||||||
|       - |       - | ||||||
|         name: Dump context |         name: Dump context | ||||||
|         if: always() |         if: always() | ||||||
| @ -243,6 +253,7 @@ jobs: | |||||||
|         uses: actions/checkout@v2.3.3 |         uses: actions/checkout@v2.3.3 | ||||||
|       - |       - | ||||||
|         name: Build |         name: Build | ||||||
|  |         id: docker_build | ||||||
|         continue-on-error: ${{ matrix.push }} |         continue-on-error: ${{ matrix.push }} | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
| @ -250,6 +261,17 @@ jobs: | |||||||
|           file: ./test/Dockerfile |           file: ./test/Dockerfile | ||||||
|           push: ${{ matrix.push }} |           push: ${{ matrix.push }} | ||||||
|           tags: localhost:5000/name/app:latest |           tags: localhost:5000/name/app:latest | ||||||
|  |       - | ||||||
|  |         name: Check | ||||||
|  |         run: | | ||||||
|  |           echo "${{ toJson(steps.docker_build) }}" | ||||||
|  |           if [ "${{ matrix.push }}" = "false" ]; then | ||||||
|  |             exit 0 | ||||||
|  |           fi | ||||||
|  |           if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then | ||||||
|  |             echo "::error::Should have failed" | ||||||
|  |             exit 1 | ||||||
|  |           fi | ||||||
|       - |       - | ||||||
|         name: Dump context |         name: Dump context | ||||||
|         if: always() |         if: always() | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user