Skip to content

Commit eeac821

Browse files
committed
Build container image on release, not tag
1 parent 012ece4 commit eeac821

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Docker Image
1+
name: Docker
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
tags: [ "v*" ]
5+
branches:
6+
- main
77
pull_request:
8-
branches: [ "main" ]
8+
branches:
9+
- main
10+
release:
11+
types:
12+
- published
913

1014
jobs:
1115
docker:
@@ -19,6 +23,8 @@ jobs:
1923
icinga/icinga-kubernetes
2024
tags: |
2125
type=edge
26+
type=semver,pattern={{version}}
27+
type=semver,pattern={{major}}.{{minor}}
2228
2329
- name: Set up QEMU
2430
uses: docker/setup-qemu-action@v3
@@ -41,3 +47,7 @@ jobs:
4147
platforms: linux/amd64,linux/arm64
4248
push: ${{ github.event_name != 'pull_request' }}
4349
tags: ${{ steps.meta.outputs.tags }}
50+
# Keep the .git to allow including the commit in the --version output, see also:
51+
# https://docs.docker.com/build/building/context/#keep-git-directory
52+
build-args: |
53+
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1

0 commit comments

Comments
 (0)