From e83824b59a8eea2011dfcbab9d9ce8163b538905 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Thu, 27 Feb 2025 09:44:29 +0530 Subject: [PATCH 1/3] ci: push rook image to other oci like quay,ghcr currently rook images are only available in docker, let's start pushing rook images to quay.io and ghcr.io as well. Signed-off-by: subhamkrai (cherry picked from commit df3c757141636528889180d1ea7f82d8aada834f) --- .github/workflows/push-build.yaml | 14 ++++++++++++++ build/release/Makefile | 10 ++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index 14508c99f..ec180c14a 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -41,6 +41,20 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_ROBOT_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GIT_API_TOKEN }} + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: diff --git a/build/release/Makefile b/build/release/Makefile index e8b592306..efb068736 100644 --- a/build/release/Makefile +++ b/build/release/Makefile @@ -66,8 +66,10 @@ FLAVORS ?= output override BRANCH_NAME := pr/$(BRANCH_NAME) endif -DOCKER_REGISTRY ?= rook -REGISTRIES ?= $(DOCKER_REGISTRY) +DOCKER_REGISTRY ?= docker.io/rook +QUAY_REGISTRY ?= quay.io/rook +GHCR_REGISTRY ?= ghcr.io/rook +REGISTRIES ?= $(DOCKER_REGISTRY) $(QUAY_REGISTRY) $(GHCR_REGISTRY) IMAGE_ARCHS := $(subst linux_,,$(filter linux_%,$(PLATFORMS))) IMAGE_PLATFORMS := $(subst _,/,$(subst $(SPACE),$(COMMA),$(filter linux_%,$(PLATFORMS)))) IMAGE_PLATFORMS_COMMA := $(shell echo "$(IMAGE_PLATFORMS)" | sed 's/ /,/g' | sed 's/.$$//') @@ -191,10 +193,14 @@ $(foreach r,$(REGISTRIES), $(foreach i,$(IMAGES), $(foreach a,$(IMAGE_ARCHS),$(e publish.manifest.image.%: publish.all.images $(MANIFEST_TOOL) $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(VERSION) + $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(QUAY_REGISTRY)/$*-ARCH:$(VERSION) --target $(QUAY_REGISTRY)/$*:$(VERSION) + $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(GHCR_REGISTRY)/$*-ARCH:$(VERSION) --target $(GHCR_REGISTRY)/$*:$(VERSION) # add the "master" tag to the master image, but do not add the "release" tag for the release channel promote.manifest.image.%: promote.all.images $(MANIFEST_TOOL) [ "$(CHANNEL)" = "release" ] || $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(CHANNEL) + [ "$(CHANNEL)" = "release" ] || $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(QUAY_REGISTRY)/$*-ARCH:$(VERSION) --target $(QUAY_REGISTRY)/$*:$(CHANNEL) + [ "$(CHANNEL)" = "release" ] || $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS_COMMA) --template $(GHCR_REGISTRY)/$*-ARCH:$(VERSION) --target $(GHCR_REGISTRY)/$*:$(CHANNEL) build.images: build.all.images publish.images: $(addprefix publish.manifest.image.,$(IMAGES)) From fd1931aaaf530fdaa3453c811999e42d3d9b95a4 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Mon, 3 Mar 2025 22:11:01 +0530 Subject: [PATCH 2/3] ci: use github token instead of api token github token should be used intead of api token for ghcr Signed-off-by: subhamkrai (cherry picked from commit 1ba567a39e06e5d8fd72676e9fbb95f6e594a140) --- .github/workflows/push-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index ec180c14a..c1a8ebfed 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -53,7 +53,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GIT_API_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 From 39adcc751cc84c66d3d35f860bbf54517265167b Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Mon, 3 Mar 2025 10:29:58 -0700 Subject: [PATCH 3/3] ci: add packages write permission for ghcr Publishing packages to ghcr requires the packages write permission Signed-off-by: Travis Nielsen (cherry picked from commit 62ee784ae31b734f2af7704f0de1271ea8f419a8) --- .github/workflows/push-build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index c1a8ebfed..a0f05c550 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -14,6 +14,7 @@ defaults: permissions: contents: read + packages: write jobs: push-image-to-container-registry: