Skip to content

Commit 343653a

Browse files
committed
support chat command for ci workflow
1 parent 137744f commit 343653a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
issue_comment:
8+
types: [created, edited]
79

810
env:
911
REGISTRY: docker.io
@@ -14,6 +16,7 @@ jobs:
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"
@@ -23,6 +26,7 @@ jobs:
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
@@ -33,5 +37,6 @@ jobs:
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}"

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)