Skip to content

Commit

Permalink
Merge pull request #33 from CoverGo/feat/pass-docker-meta-created-dat…
Browse files Browse the repository at this point in the history
…e-time-as-build-arg

feat(docker build): Pass docker meta creation date as build arg
  • Loading branch information
NazmiAltun authored Dec 6, 2022
2 parents c23b6df + d946c58 commit b23c081
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gflows/libs/steps.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ with:
#@ end
#@ build_args.append("COMMIT_SHA=${{ github.sha }}")
#@ if build_versioned_image:
#@ build_args.append("BUILD_DATETIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}")
#@ build_args.append("APP_VERSION=${{ needs.version.outputs.app_version }}")
#@ build_args.append("FILE_VERSION=${{ needs.version.outputs.file_version }}")
#@ build_args.append("INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}")
Expand Down
4 changes: 4 additions & 0 deletions github-sample/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
type=registry,ref=ghcr.io/covergo/auth-nuget-cache:${{ needs.version.outputs.issue_id_slug }}
build-args: |-
COMMIT_SHA=${{ github.sha }}
BUILD_DATETIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
Expand Down Expand Up @@ -182,6 +183,7 @@ jobs:
cache-to: type=registry,ref=ghcr.io/covergo/auth-nuget-default-cache:${{ needs.version.outputs.issue_id_slug }},mode=max
build-args: |-
COMMIT_SHA=${{ github.sha }}
BUILD_DATETIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
Expand Down Expand Up @@ -266,6 +268,7 @@ jobs:
build-args: |-
NOW="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
COMMIT_SHA=${{ github.sha }}
BUILD_DATETIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
Expand Down Expand Up @@ -314,6 +317,7 @@ jobs:
target: build-predeployment
build-args: |-
COMMIT_SHA=${{ github.sha }}
BUILD_DATETIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
Expand Down

0 comments on commit b23c081

Please sign in to comment.