Skip to content

Commit 01a042d

Browse files
committed
ci: fix broken ci
1 parent 4fe0b75 commit 01a042d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ GIT_BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD)
99
BUILD_DATE := $(shell date +%Y-%m-%dT%H:%M:%SZ)
1010
IMAGE_NAME ?= ghcr.io/segator/transcoderd
1111
PROJECT_VERSION ?= $(shell cat version.txt)-dev
12-
export NO_CACHE
12+
NO_CACHE ?=false
13+
1314

1415
.DEFAULT: help
1516
.PHONY: help
@@ -39,13 +40,13 @@ DOCKER_BUILD_ARG := --cache-to type=inline
3940
.PHONY: buildcontainer-%
4041
.PHONY: publishcontainer-%
4142
buildcontainer-% publishcontainer-%:
42-
@export DOCKER_BUILD_ARG="$(DOCKER_BUILD_ARG) $(if $(findstring publishcontainer,$@),--push,--load) $(if $(NO_CACHE),--no-cache,) "; \
43-
@docker buildx build \
43+
@export DOCKER_BUILD_ARG="$(DOCKER_BUILD_ARG) $(if $(findstring publishcontainer,$@),--push,--load) $(if $(filter true,$(NO_CACHE)),--no-cache,)"; \
44+
docker buildx build \
4445
$${DOCKER_BUILD_ARG} \
45-
--cache-from $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \ # Generally for non main branches cache
46-
--cache-from $(IMAGE_NAME):$*-main \ # In case no cache for branches use main cache
47-
-t $(IMAGE_NAME):$*-$(PROJECT_VERSION) \ # Publish specific version image
48-
-t $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \ # publish specific branch image for cache porpuses
46+
--cache-from $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \
47+
--cache-from $(IMAGE_NAME):$*-main \
48+
-t $(IMAGE_NAME):$*-$(PROJECT_VERSION) \
49+
-t $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \
4950
-f Dockerfile \
5051
--target $* \
5152
. ;

0 commit comments

Comments
 (0)