Skip to content

Commit 2a700de

Browse files
committed
Fix Docker build by properly handling BUILD_DATE environment variable
1 parent ad26ac1 commit 2a700de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/docker-build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ jobs:
7373
username: ${{ github.actor }}
7474
password: ${{ secrets.GITHUB_TOKEN }}
7575

76+
- name: Set build date
77+
id: build_date
78+
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
79+
7680
- name: Build and export Docker image
7781
uses: docker/build-push-action@v6
7882
with:
@@ -87,7 +91,7 @@ jobs:
8791
build-args: |
8892
VERSION=${{ steps.meta.outputs.version }}
8993
COMMIT_SHA=${{ github.sha }}
90-
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
94+
BUILD_DATE=${{ steps.build_date.outputs.BUILD_DATE }}
9195
9296
- name: Scan image for vulnerabilities
9397
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)