From cd62740e09d5f76660bce2dfd5aad3037a0ef09b Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Wed, 16 Oct 2024 08:19:20 +0200 Subject: [PATCH] Revert "DROP: Allow building container image on merge conflicts" This reverts commit f88b1348e1c788fceb08125efe6b8fd1c617f004. --- .github/workflows/docker.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 68660213..17a98645 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,7 +1,15 @@ --- name: Docker Build Action on: + pull_request: + branches: + - master + release: + types: + - published push: + branches: + - master env: REGISTRY: ghcr.io @@ -25,9 +33,15 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} + - name: Make tag + run: | + [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true + [ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true + [ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true + - name: Build and push image uses: docker/build-push-action@v6 with: context: . push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:update-cilium-extension + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }}