Skip to content

Commit

Permalink
chore: docker build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
JashBook committed Jul 12, 2023
1 parent 7b41213 commit 364239c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cicd-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
outputs:
trigger-mode: ${{ steps.get_trigger_mode.outputs.trigger_mode }}
steps:
- name: Cancel Previous Runs
if: github.ref_name != 'main'
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}
# - name: Cancel Previous Runs
# if: github.ref_name != 'main'
# uses: styfle/cancel-workflow-action@0.11.0
# with:
# all_but_latest: true
# access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions docker/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ endif


.PHONY: build-manager-image
build-manager-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-manager-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-manager-image
# build-manager-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-manager-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-manager-image
build-manager-image: install-docker-buildx generate ## Build Operator manager container image.
ifneq ($(BUILDX_ENABLED), true)
$(DOCKER) build . $(DOCKER_BUILD_ARGS) --file $(DOCKERFILE_DIR)/Dockerfile --tag ${IMG}:${VERSION} --tag ${IMG}:latest
Expand All @@ -85,7 +85,7 @@ endif


.PHONY: push-manager-image
push-manager-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-manager-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-manager-image
# push-manager-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-manager-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-manager-image
push-manager-image: install-docker-buildx generate ## Push Operator manager container image.
ifneq ($(BUILDX_ENABLED), true)
ifeq ($(TAG_LATEST), true)
Expand All @@ -103,7 +103,7 @@ endif


.PHONY: build-tools-image
build-tools-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-tools-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-tools-image
# build-tools-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-tools-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-tools-image
build-tools-image: install-docker-buildx generate test-go-generate ## Build tools container image.
ifneq ($(BUILDX_ENABLED), true)
$(DOCKER) build . $(DOCKER_BUILD_ARGS) --file $(DOCKERFILE_DIR)/Dockerfile-tools --tag ${TOOL_IMG}:${VERSION} --tag ${TOOL_IMG}:latest
Expand All @@ -116,7 +116,7 @@ endif
endif

.PHONY: push-tools-image
push-tools-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-tools-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-tools-image
# push-tools-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-tools-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-tools-image
push-tools-image: install-docker-buildx generate test-go-generate ## Push tools container image.
ifneq ($(BUILDX_ENABLED), true)
ifeq ($(TAG_LATEST), true)
Expand All @@ -133,7 +133,7 @@ endif
endif

.PHONY: build-charts-image
build-charts-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-charts-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-charts-image
# build-charts-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-charts-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-charts-image
build-charts-image: install-docker-buildx helm-package ## Build helm charts container image.
ifneq ($(BUILDX_ENABLED), true)
$(DOCKER) build . $(DOCKER_BUILD_ARGS) --file $(DOCKERFILE_DIR)/Dockerfile-charts --tag ${CHARTS_IMG}:${VERSION} --tag ${CHARTS_IMG}:latest
Expand All @@ -147,7 +147,7 @@ endif


.PHONY: push-charts-image
push-charts-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-charts-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-charts-image
# push-charts-image: DOCKER_BUILD_ARGS += --cache-to type=gha,mode=max,scope=${GITHUB_REF_NAME}-charts-image --cache-from type=gha,scope=${GITHUB_REF_NAME}-charts-image
push-charts-image: install-docker-buildx helm-package ## Push helm charts container image.
ifneq ($(BUILDX_ENABLED), true)
ifeq ($(TAG_LATEST), true)
Expand Down

0 comments on commit 364239c

Please sign in to comment.