Use outputs
This commit is contained in:
13
.github/workflows/build_docker.yml
vendored
13
.github/workflows/build_docker.yml
vendored
@@ -45,6 +45,13 @@ jobs:
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Generate build variables
|
||||
id: prep
|
||||
run: |
|
||||
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
||||
echo "go_version=$(go version | cut -d ' ' -f 3)" >> $GITHUB_OUTPUT
|
||||
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
@@ -56,9 +63,9 @@ jobs:
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
build-args: |
|
||||
BuiltAt=$(date +%Y-%m-%dT%H:%M:%S)
|
||||
GoVersion=$(go version)
|
||||
GitCommit=$(git rev-parse HEAD)
|
||||
BuiltAt=${{ steps.prep.outputs.built_at }}'
|
||||
GoVersion=${{ steps.prep.outputs.go_version }}'
|
||||
GitCommit=${{ steps.prep.outputs.git_commit }}'
|
||||
Version=${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
|
||||
Reference in New Issue
Block a user