From 5bdb760b47a4a2c9f2d733055031eb0d6a551e2a Mon Sep 17 00:00:00 2001 From: mzeevi Date: Tue, 14 May 2024 17:51:00 +0000 Subject: [PATCH] add install.yaml as asset as part of release ci Signed-off-by: mzeevi --- .github/workflows/release.yaml | 14 +++++++++++--- Makefile | 11 +++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fa32c9a..aec8503 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,18 +12,26 @@ jobs: name: Build and push image runs-on: ubuntu-latest permissions: - contents: read + contents: write packages: write steps: - name: Checkout uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 + uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push image - run: make docker-build docker-push IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}:${GITHUB_REF##*/} \ No newline at end of file + run: make docker-build docker-push IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}:${GITHUB_REF##*/} + + - name: Create install.yaml file + run: make build/install.yaml IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}:${GITHUB_REF##*/} + + - name: Upload install.yaml file + uses: softprops/action-gh-release@v2 + with: + files: ./build/install.yaml \ No newline at end of file diff --git a/Makefile b/Makefile index 39aea44..33c3988 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,17 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: build/install.yaml +build/install.yaml: manifests kustomize + mkdir -p $(dir $@) && \ + rm -rf build/kustomize && \ + mkdir -p build/kustomize && \ + cd build/kustomize && \ + $(KUSTOMIZE) create --resources ../../config/default && \ + $(KUSTOMIZE) edit set image controller=${IMG} && \ + cd ${CURDIR} && \ + $(KUSTOMIZE) build build/kustomize > $@ + ##@ Dependencies ## Location to install dependencies to