8383 # stage via buildx cache. Each image is published at
8484 # ghcr.io/<owner>/<binary> with the release tag and `latest`.
8585
86+ # Mirrors GoReleaser's {{.Version}} / {{.Commit}} / {{.Date}} so
87+ # binaries inside the images report the same buildinfo as the
88+ # tarball binaries.
89+ - name : Compute Docker build metadata
90+ run : |
91+ {
92+ echo "BUILD_VERSION=${GITHUB_REF_NAME#v}"
93+ echo "BUILD_COMMIT=${GITHUB_SHA}"
94+ echo "BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
95+ } >> "$GITHUB_ENV"
96+
8697 - name : Docker meta — prosa (CLI)
8798 id : meta-cli
8899 uses : docker/metadata-action@v6
@@ -101,6 +112,10 @@ jobs:
101112 push : true
102113 tags : ${{ steps.meta-cli.outputs.tags }}
103114 labels : ${{ steps.meta-cli.outputs.labels }}
115+ build-args : |
116+ VERSION=${{ env.BUILD_VERSION }}
117+ COMMIT=${{ env.BUILD_COMMIT }}
118+ BUILD_DATE=${{ env.BUILD_DATE }}
104119
105120 - name : Docker meta — prosa-server
106121 id : meta-server
@@ -120,6 +135,10 @@ jobs:
120135 push : true
121136 tags : ${{ steps.meta-server.outputs.tags }}
122137 labels : ${{ steps.meta-server.outputs.labels }}
138+ build-args : |
139+ VERSION=${{ env.BUILD_VERSION }}
140+ COMMIT=${{ env.BUILD_COMMIT }}
141+ BUILD_DATE=${{ env.BUILD_DATE }}
123142
124143 - name : Docker meta — prosa-panel
125144 id : meta-panel
@@ -139,3 +158,7 @@ jobs:
139158 push : true
140159 tags : ${{ steps.meta-panel.outputs.tags }}
141160 labels : ${{ steps.meta-panel.outputs.labels }}
161+ build-args : |
162+ VERSION=${{ env.BUILD_VERSION }}
163+ COMMIT=${{ env.BUILD_COMMIT }}
164+ BUILD_DATE=${{ env.BUILD_DATE }}
0 commit comments