From ef2ea999dfeab3521c568e5010bd9d2b38e2759f Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Sun, 7 Jan 2024 08:22:24 +0100 Subject: [PATCH] only run release to docker when containing [release] --- .github/workflows/docker-dev.yml | 4 ++++ .github/workflows/docker.yml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-dev.yml index e990ded..587c41c 100644 --- a/.github/workflows/docker-dev.yml +++ b/.github/workflows/docker-dev.yml @@ -7,6 +7,8 @@ on: jobs: build-amd64: runs-on: ubuntu-latest + # If contains the keyword "[release]" in the commit message. + if: "contains(github.event.head_commit.message, '[release]')" strategy: matrix: architecture: [amd64] @@ -32,6 +34,8 @@ jobs: run: docker buildx imagetools create -t kerberos/agent-dev:latest kerberos/agent-dev:arch-$(echo ${{matrix.architecture}} | tr / -)-$(echo $GITHUB_SHA | cut -c1-7) build-other: runs-on: ubuntu-latest + # If contains the keyword "[release]" in the commit message. + if: "contains(github.event.head_commit.message, '[release]')" strategy: matrix: #architecture: [arm64, arm/v7, arm/v6] diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 45fb18b..2578be1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,6 +2,7 @@ name: Docker master build on: push: + # If pushed to master branch. branches: [ master ] env: @@ -10,6 +11,8 @@ env: jobs: build-amd64: runs-on: ubuntu-latest + # If contains the keyword "[release]" in the commit message. + if: "contains(github.event.head_commit.message, '[release]')" permissions: contents: write strategy: @@ -68,6 +71,8 @@ jobs: # run: tar -xf agent-${{matrix.architecture}}.tar && snapcraft build-other: runs-on: ubuntu-latest + # If contains the keyword "[release]" in the commit message. + if: "contains(github.event.head_commit.message, '[release]')" permissions: contents: write needs: build-amd64