ci: fix version inject

This commit is contained in:
krau
2025-08-02 10:58:29 +08:00
parent b9d14f79c8
commit 4c851cbbaf
2 changed files with 17 additions and 9 deletions

View File

@@ -44,6 +44,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Dockerfile args
id: args
run: |
echo "git_commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
echo "build_time=$(git show -s --format=%cI)" >> "$GITHUB_OUTPUT"
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
@@ -59,5 +65,5 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version }}
GitCommit=${{ github.sha }}
BuildTime=${{ fromJson(toJSON(github.event.repository.pushed_at)) }}
GitCommit=${{ steps.args.outputs.git_commit }}
BuildTime=${{ steps.args.outputs.build_time }}