29
29
uses : actions/checkout@v2
30
30
with :
31
31
fetch-depth : 0
32
+
33
+ - name : Retrieve version
34
+ run : echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
32
35
33
36
- name : Get Docker tags for Alpine based image
34
37
if : ${{ matrix.base == 'alpine' }}
42
45
type=semver,pattern={{version}}
43
46
type=semver,pattern={{major}}.{{minor}}
44
47
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
48
+ labels : |
49
+ org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
45
50
46
51
- name : Get Docker tags for Debian based image
47
52
if : ${{ matrix.base == 'debian' }}
@@ -55,11 +60,10 @@ jobs:
55
60
type=semver,suffix=-debian,pattern={{version}}
56
61
type=semver,suffix=-debian,pattern={{major}}.{{minor}}
57
62
type=raw,value=debian,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
63
+ labels : |
64
+ org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
58
65
flavor : latest=false
59
66
60
- - name : Retrieve version
61
- run : echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
62
-
63
67
- name : Set up QEMU
64
68
uses : docker/setup-qemu-action@v1
65
69
77
81
id : docker_build_alpine
78
82
uses : docker/build-push-action@v2
79
83
with :
80
- build-args : VERSION=${{ env.VERSION }}
84
+ build-args : VERSION=${{ env.GIT_DESCRIBE }}
81
85
platforms : linux/amd64,linux/arm64,linux/arm/v7
82
86
push : true
83
87
tags : ${{ steps.docker_meta_alpine.outputs.tags }}
88
92
id : docker_build_debian
89
93
uses : docker/build-push-action@v2
90
94
with :
91
- build-args : VERSION=${{ env.VERSION }}
95
+ build-args : VERSION=${{ env.GIT_DESCRIBE }}
92
96
file : Dockerfile.debian
93
97
platforms : linux/amd64,linux/arm64,linux/arm/v7
94
98
push : true
0 commit comments