File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7+ issue_comment :
8+ types : [created, edited]
79
810env :
911 REGISTRY : docker.io
1416 coverage :
1517 name : unit test coverage
1618 runs-on : ubuntu-latest
19+ if : github.event_name == "push" || contains(github.event.comment.body, "/unit-test")
1720 steps :
1821 - uses : actions/checkout@master
1922 - run : " make unit-test-cover"
2326 build :
2427 name : docker build & push
2528 runs-on : ubuntu-latest
29+ if : github.event_name == "push" || contains(github.event.comment.body, "/buid-push")
2630 steps :
2731 - name : Checkout repository
2832 uses : actions/checkout@v4
3337 username : ${{ secrets.DOCKER_USERNAME }}
3438 password : ${{ secrets.DOCKER_PASSWORD }}
3539
40+ # platform = linux/amd64,linux/arm64
3641 - name : Build and push Docker image
37- run : " make docker-build docker-push IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_SHA::7}"
42+ run : " make docker-buildx IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_SHA::7}"
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
143143# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
144144# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
145145.PHONY : docker-build
146- docker-build : # test ## Build docker image with the manager.
146+ docker-build : unit- test # # Build docker image with the manager.
147147 docker build -t ${IMG} .
148148
149149.PHONY : docker-push
@@ -156,9 +156,9 @@ docker-push: ## Push docker image with the manager.
156156# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
157157# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
158158# To properly provided solutions that supports more than one platform you should use this option.
159- PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
159+ PLATFORMS ?= linux/arm64,linux/amd64 # ,linux/s390x,linux/ppc64le
160160.PHONY: docker-buildx
161- docker-buildx : test # # Build and push docker image for the manager for cross-platform support
161+ docker-buildx : # # Build and push docker image for the manager for cross-platform support
162162 # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
163163 sed -e ' 1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
164164 - docker buildx create --name project-v3-builder
You can’t perform that action at this time.
0 commit comments