From 7bb0bf565cf4c69ac62f636edfeb529c5e88fae8 Mon Sep 17 00:00:00 2001 From: Akshay Gaikwad Date: Thu, 26 May 2022 12:22:34 +0530 Subject: [PATCH 1/3] CI(Release): Build image on push to main branch Signed-off-by: Akshay Gaikwad --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0836e05..e120076 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,7 @@ name: Create, publish container image on: push: + branches: [ main ] tags: [ 'v*.*.*' ] env: @@ -42,6 +43,12 @@ jobs: uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=sha - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc From 8c64af636ff5c6103df6794f8b6eab728fbb3377 Mon Sep 17 00:00:00 2001 From: Akshay Gaikwad Date: Thu, 26 May 2022 12:52:46 +0530 Subject: [PATCH 2/3] Fix: Release workflow failing on test --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e120076..037e626 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,9 @@ jobs: go-version: ${{ matrix.go-version }} # Sanity check before publishing + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1.2.0 + - name: Test all run: go test -v ./... From e6664f6971c9797825ce0b257fd5efcf25f54234 Mon Sep 17 00:00:00 2001 From: Akshay Gaikwad Date: Mon, 30 May 2022 10:46:00 +0530 Subject: [PATCH 3/3] CI(Release): Build image on pull request --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 037e626..5d263eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,8 @@ on: push: branches: [ main ] tags: [ 'v*.*.*' ] + pull_request: + branches: [ main ] env: REGISTRY: registry.dev.rafay-edge.net @@ -47,7 +49,6 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=schedule type=ref,event=branch type=ref,event=tag type=ref,event=pr