diff --git a/.github/workflows/build-images-for-tag-release.yaml b/.github/workflows/build-images-for-tag-release.yaml index 837802a..6178f9b 100644 --- a/.github/workflows/build-images-for-tag-release.yaml +++ b/.github/workflows/build-images-for-tag-release.yaml @@ -48,6 +48,7 @@ jobs: build-args: | GIT_SHA=${{ github.sha }} DIRTY=false + VERSION=${{ github.ref_name }} dockerfiles: | ./Dockerfile diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 7d4c0c7..fe3041b 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -26,6 +26,12 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - name: Read release string version + id: release + run: | + version=`make read-release-version` + echo version=$version >> $GITHUB_OUTPUT + - name: Add latest tag if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} id: add-latest-tag @@ -47,6 +53,7 @@ jobs: build-args: | GIT_SHA=${{ github.sha }} DIRTY=false + VERSION=${{ steps.release.outputs.version }} dockerfiles: | ./Dockerfile diff --git a/Makefile b/Makefile index 97b1729..8484cc6 100644 --- a/Makefile +++ b/Makefile @@ -254,7 +254,7 @@ run-with-probes: manifests generate fmt vet ## Run a controller from your host. docker-build: GIT_SHA=$(shell git rev-parse HEAD || echo "unknown") docker-build: DIRTY=$(shell hack/check-git-dirty.sh || echo "unknown") docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . --build-arg GIT_SHA=$(GIT_SHA) --build-arg DIRTY=$(DIRTY) + $(CONTAINER_TOOL) build -t ${IMG} . --build-arg VERSION=v$(VERSION) --build-arg GIT_SHA=$(GIT_SHA) --build-arg DIRTY=$(DIRTY) .PHONY: docker-push docker-push: ## Push docker image with the manager.