From fb4e8441cac261bb12a920e0c67ea30115df92bf Mon Sep 17 00:00:00 2001 From: Jeffrey Limnardy Date: Tue, 17 Sep 2024 16:34:43 +0200 Subject: [PATCH 1/2] workflow for image build --- .github/workflows/build-image.yml | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build-image.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..3f632e5 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,53 @@ +name: Build Image + +on: + pull_request_target: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - "main" + - "release-[0-9]+.[0-9]+" + paths-ignore: + - 'docs/**' + - '**/*.md' + - 'OWNERS' + - 'CODEOWNERS' + push: + branches: + - "main" + - "release-[0-9]+.[0-9]+" + tags: + - "[0-9]+.[0-9]+.[0-9]+(-.*)?" + paths-ignore: + - 'docs/**' + - '**/*.md' + - 'OWNERS' + - 'CODEOWNERS' +jobs: + envs: + runs-on: ubuntu-latest + outputs: + tags: ${{ steps.create-tags.outputs.tags }} + + steps: + - name: create tags + id: create-tags + run: | + if [[ $GITHUB_EVENT_NAME == 'push' ]]; then + echo 'TAGS=${{ github.ref_name }}' >> "$GITHUB_OUTPUT" + else + { + echo 'tags<> "$GITHUB_OUTPUT" + fi + + build-image: + needs: envs + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main + with: + name: kyma-metrics-collector + dockerfile: Dockerfile + context: . + tags: ${{ needs.envs.outputs.tags }} From 3017b151bcdc4ee0af251cd4714b265e296118b4 Mon Sep 17 00:00:00 2001 From: Jeffrey Limnardy Date: Tue, 17 Sep 2024 17:03:25 +0200 Subject: [PATCH 2/2] remove release branches as trigger --- .github/workflows/build-image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3f632e5..70f5e9c 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -14,7 +14,6 @@ on: push: branches: - "main" - - "release-[0-9]+.[0-9]+" tags: - "[0-9]+.[0-9]+.[0-9]+(-.*)?" paths-ignore: