Trying new build strategy
This commit is contained in:
		
							
								
								
									
										18
									
								
								.github/workflows/build.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/build.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -13,18 +13,20 @@ jobs: | ||||
|             - name: Build Container | ||||
|               run: | | ||||
|                 git clone -b "${{github.ref_name}}" "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" . | ||||
|                 REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% ) | ||||
|                 VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+') | ||||
|                 PREFIX=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% ) | ||||
|                  | ||||
|                 docker build -t $PREFIX/${{ github.repository }}:${{ github.ref_name }} . | ||||
|                 docker push $PREFIX/${{ github.repository }}:${{ github.ref_name }} | ||||
|                 docker login -u ${{repository_owner}} -p ${{secrets.DEPLOY_TOKEN}} $REGISTRY | ||||
|                    | ||||
|                 docker tag $PREFIX/${{ github.repository }}:$VERSION $PREFIX/${{ github.repository }}:${{ github.ref_name }} | ||||
|                 docker push $PREFIX/${{ github.repository }}:$VERSION | ||||
|                 docker build -t $REGISTRY/${{github.repository}}:${{ github.ref_name}} . | ||||
|                 docker push $REGISTRY/${{github.repository}}:${{ github.ref_name}} | ||||
|                  | ||||
|                 docker tag $REGISTRY/${{github.repository}}:$VERSION $REGISTRY/${{github.repository}}:${{github.ref_name}} | ||||
|                 docker push $REGISTRY/${{github.repository}}:$VERSION | ||||
|                  | ||||
|                 [ '${{github.ref_name}}' == 'master' ] && \ | ||||
|                   docker tag $PREFIX/${{ github.repository }}:latest $PREFIX/${{ github.repository }}:${{ github.ref_name }} && \ | ||||
|                   docker push $PREFIX/${{ github.repository }}:latest || echo '' | ||||
|                   docker tag $REGISTRY/${{github.repository}}:latest $REGISTRY/${{github.repository}}:${{github.ref_name}} && \ | ||||
|                   docker push $REGISTRY/${{github.repository}}:latest || echo '' | ||||
|  | ||||
|     tag: | ||||
|         name: Git Tag | ||||
| @@ -36,5 +38,5 @@ jobs: | ||||
|                 git clone -b "${{github.ref_name}}" "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" . | ||||
|                 VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+') | ||||
|                    | ||||
|                 tag -f $VERSION ${{github.sha}} | ||||
|                 git tag -f $VERSION ${{github.sha}} | ||||
|                 git push -f origin $VERSION | ||||
|   | ||||
		Reference in New Issue
	
	Block a user