Skip to content

Commit ef34965

Browse files
authored
ci: fix make builders.push BUILDERS_TAG=latest (#102)
Signed-off-by: Yaroslav Skopets <[email protected]>
1 parent ab46d0a commit ef34965

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/workflows/builders.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ jobs:
2929
- name: Push the Docker image
3030
run: make builders.push BUILDERS_TAG=${{ github.sha }}
3131
if: github.event_name == 'push'
32-
33-
- name: Mark the Docker image latest
32+
33+
- name: Tag the Docker image as 'latest'
34+
run: make builders.tag BUILDERS_TAG=${{ github.sha }} EXTRA_TAG=latest
35+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
36+
37+
- name: Push the 'latest' Docker image
3438
run: make builders.push BUILDERS_TAG=latest
3539
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ HUB ?= docker.io/getenvoy
1717
GETENVOY_TAG ?= dev
1818
BUILDERS_LANGS := rust
1919
BUILDERS_TAG ?= latest
20+
EXTRA_TAG ?=
2021

2122
USE_DOCKER_BUILDKIT_CACHE ?= yes
2223
ifneq ($(filter-out yes on true 1,$(USE_DOCKER_BUILDKIT_CACHE)),)
@@ -149,6 +150,16 @@ $(foreach lang,$(BUILDERS_LANGS),$(eval $(call GEN_PUSH_EXTENSION_BUILDER_IMAGE_
149150
.PHONY: builders.push
150151
builders.push: $(foreach lang,$(BUILDERS_LANGS), push/builder/$(lang))
151152

153+
define GEN_TAG_EXTENSION_BUILDER_IMAGE_TARGET
154+
.PHONY: tag/builder/$(1)
155+
tag/builder/$(1):
156+
docker tag $(call EXTENSION_BUILDER_IMAGE,$(1),$(BUILDERS_TAG)) $(call EXTENSION_BUILDER_IMAGE,$(1),$(EXTRA_TAG))
157+
endef
158+
$(foreach lang,$(BUILDERS_LANGS),$(eval $(call GEN_TAG_EXTENSION_BUILDER_IMAGE_TARGET,$(lang))))
159+
160+
.PHONY: builders.tag
161+
builders.tag: $(foreach lang,$(BUILDERS_LANGS), tag/builder/$(lang))
162+
152163
define GEN_PULL_EXTENSION_BUILDER_IMAGE_TARGET
153164
.PHONY: pull/builder/$(1)
154165
pull/builder/$(1):

0 commit comments

Comments
 (0)