From ff9a1ed27cbdadcf656509b81e94b114ca07a2e8 Mon Sep 17 00:00:00 2001 From: Mirah Gary Date: Wed, 23 Apr 2025 12:11:31 +0200 Subject: [PATCH] Additionally publish to quay.io. --- .github/workflows/build-test-publish.yml | 15 +++++++++++++-- Makefile | 5 ++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 8b344904..2caa7ecf 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -78,7 +78,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: rabbitmqoperator/messaging-topology-operator + images: | + rabbitmqoperator/messaging-topology-operator + quay.io/rabbitmqoperator/messaging-topology-operator # generate Docker tags based on the following events/attributes tags: | type=sha @@ -97,6 +99,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Quay.io + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_ROBOT_TOKEN }} + - name: Build and push if: ${{ startsWith(github.ref, 'refs/tags/v') }} uses: docker/build-push-action@v6 @@ -138,7 +147,7 @@ jobs: kustomize edit set image \ rabbitmqoperator/messaging-topology-operator-dev=rabbitmqoperator/messaging-topology-operator:"${RELEASE_VERSION}" popd - make generate-manifests + make generate-manifests QUAY_IO_OPERATOR_IMAGE=quay.io/rabbitmqoperator/messaging-topology-operator:"${RELEASE_VERSION}" - name: Upload operator manifests uses: actions/upload-artifact@v4 @@ -248,6 +257,8 @@ jobs: files: | messaging-topology-operator.yaml messaging-topology-operator-with-certmanager.yaml + messaging-topology-operator-quay-io.yaml + messaging-topology-operator-with-certmanager-quay-io.yaml generate_release_notes: true draft: true fail_on_unmatched_files: true diff --git a/Makefile b/Makefile index 289eecf4..219a10fa 100644 --- a/Makefile +++ b/Makefile @@ -154,13 +154,16 @@ api-reference: --output-path ./docs/api/rabbitmq.com.ref.asciidoc \ --max-depth 30 +QUAY_IO_OPERATOR_IMAGE ?= quay.io/rabbitmqoperator/messaging-topology-operator:latest ## used in CI pipeline to create release artifact .PHONY: generate-manifests -generate-manifests: +generate-manifests: | $(YTT) mkdir -p releases kustomize build config/installation/ > releases/messaging-topology-operator.bak sed '/CERTIFICATE_NAMESPACE.*CERTIFICATE_NAME/d' releases/messaging-topology-operator.bak > releases/messaging-topology-operator.yaml + $(YTT) -f releases/messaging-topology-operator.yml -f config/ytt-overlays/change_deployment_image.yml --data-value operator_image=$(QUAY_IO_OPERATOR_IMAGE) > releases/messaging-topology-operator-quay-io.yaml kustomize build config/installation/cert-manager/ > releases/messaging-topology-operator-with-certmanager.yaml + $(YTT) -f releases/messaging-topology-with-certmanager.yaml -f config/ytt-overlays/change_deployment_image.yml --data-value operator_image=$(QUAY_IO_OPERATOR_IMAGE) > releases/messaging-topology-operator-with-certmanager-quay-io.yaml # Run go fmt against code fmt: