Skip to content

Commit

Permalink
feat: add commit sha and build date
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson2427 committed Aug 16, 2024
1 parent 180e7e3 commit 9b8fbc0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9b8fbc0

Please sign in to comment.