From 9b8fbc05f94a8958c6b32d4a6f7c897d708abcc4 Mon Sep 17 00:00:00 2001 From: johnson2427 Date: Fri, 16 Aug 2024 13:49:04 -0500 Subject: [PATCH] feat: add commit sha and build date --- .github/workflows/build.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d72d9fd86e..f428621c87 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,6 +44,14 @@ jobs: git tag echo ${{ steps.meta.outputs.tags }} + - name: Get current date and time + id: build_date + run: echo 'BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' >> $GITHUB_ENV + + - name: Get commit sha + id: commit_sha + run: echo "VCS_REF=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Log into GitHub Container Registry if: github.event_name != 'pull_request' uses: docker/login-action@v2 @@ -59,6 +67,10 @@ jobs: file: ./Dockerfile.slim tags: ${{ steps.meta.outputs.tags }}-slim labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ version }} + BUILD_DATE=${{ env.BUILD_DATE }} + VCS_REF=${{ env.VCS_REF }} - name: Build and push uses: docker/build-push-action@v4