Save the git commit and build date of the docker images

This commit is contained in:
Roland Geider
2025-10-11 16:28:18 +02:00
parent 9140284b75
commit f6cccd339a
5 changed files with 37 additions and 3 deletions

View File

@@ -71,6 +71,9 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set build date
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
@@ -81,6 +84,9 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_COMMIT=${{ github.sha }}
# https://github.com/moby/buildkit#--export-cache-options
# https://github.com/docker/buildx#--cache-tonametypetypekeyvalue