feat(ci): tag docker image as latest only for beta (#7103)

This commit is contained in:
Alexey Shekhirin
2024-03-12 16:53:36 +00:00
committed by GitHub
parent fb30619192
commit 027d50fc10
2 changed files with 20 additions and 8 deletions

View File

@ -36,5 +36,9 @@ jobs:
run: | run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
docker buildx create --use --name cross-builder docker buildx create --use --name cross-builder
- name: Build and push image, tag as "latest"
if: ${{ contains(github.event.ref, 'beta') }}
run: make PROFILE=maxperf docker-build-push-latest
- name: Build and push image - name: Build and push image
run: make PROFILE=maxperf docker-build-latest if: ${{ ! contains(github.event.ref, 'beta') }}
run: make PROFILE=maxperf docker-build-push

View File

@ -183,20 +183,28 @@ ef-tests: $(EF_TESTS_DIR) ## Runs Ethereum Foundation tests.
# #
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` # `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder` # `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: docker-build-latest .PHONY: docker-build-push
docker-build-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`. docker-build-push: ## Build and push a cross-arch Docker image tagged with the latest git tag.
$(call build_docker_image,$(GIT_TAG),latest) $(call docker_build_push,$(GIT_TAG),$(GIT_TAG))
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: docker-build-push-latest
docker-build-push-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`.
$(call docker_build_push,$(GIT_TAG),latest)
# Note: This requires a buildx builder with emulation support. For example: # Note: This requires a buildx builder with emulation support. For example:
# #
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` # `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --name cross-builder` # `docker buildx create --use --name cross-builder`
.PHONY: docker-build-nightly .PHONY: docker-build-push-nightly
docker-build-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`. docker-build-push-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`.
$(call build_docker_image,$(GIT_TAG)-nightly,latest-nightly) $(call docker_build_push,$(GIT_TAG)-nightly,latest-nightly)
# Create a cross-arch Docker image with the given tags and push it # Create a cross-arch Docker image with the given tags and push it
define build_docker_image define docker_build_push
$(MAKE) build-x86_64-unknown-linux-gnu $(MAKE) build-x86_64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/amd64 mkdir -p $(BIN_DIR)/amd64
cp $(BUILD_PATH)/x86_64-unknown-linux-gnu/$(PROFILE)/reth $(BIN_DIR)/amd64/reth cp $(BUILD_PATH)/x86_64-unknown-linux-gnu/$(PROFILE)/reth $(BIN_DIR)/amd64/reth