Skip to content

Commit ac34c1f

Browse files
committed
Need to pass in build args to Dockerfile
Missing things like GIT_BRANCH and BUILD_DATE
1 parent 846bb6f commit ac34c1f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/main.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: prep
2727
run: |
2828
ML_PROJECT_VERSION=$(TZ=UTC git --no-pager log -n1 --date="format-local:%Y%m%dT%H%M%S" --pretty="format:%cd-%h" --abbrev=7)
29-
29+
3030
VERSION=edge
3131
if [[ $GITHUB_REF == refs/tags/* ]]; then
3232
VERSION=${GITHUB_REF#refs/tags/}
@@ -35,8 +35,8 @@ jobs:
3535
elif [[ $GITHUB_REF == refs/pull/* ]]; then
3636
VERSION=pr-${{ github.event.number }}
3737
fi
38-
39-
# Tag with both registries GHCR and
38+
39+
# Tag with both registries GHCR and
4040
if [ '${{ github.event_name != 'pull_request' }}' == 'true' ]; then
4141
# release to all registries
4242
GHCR=ghcr.io/${GITHUB_REPOSITORY,,}
@@ -47,9 +47,9 @@ jobs:
4747
ARTIFACTORY="docker-builds.pennywise.cc/${GITHUB_REPOSITORY,,}"
4848
TAGS="$ARTIFACTORY:$ML_PROJECT_VERSION"
4949
fi
50-
51-
# outputs
52-
for out in "version=${VERSION}" "tags=${TAGS}" "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"; do
50+
51+
# outputs
52+
for out in "build-date=$(date +%Y%m%d-%H:%M:%S)" "build-user=$(whoami)" "git-branch=$(git rev-parse --abbrev-ref HEAD)" "git-version=$(git rev-parse HEAD)" "version=${VERSION}" "tags=${TAGS}" "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"; do
5353
# echo "k=v" >> $GITHUB_OUTPUT
5454
echo $out | tee >(cat) >> $GITHUB_OUTPUT
5555
done
@@ -102,5 +102,10 @@ jobs:
102102
cache-from: type=gha
103103
cache-to: type=gha
104104
build-args: |
105-
ARTIFACTORY_PASSWORD=${{secrets.ARTIFACTORY_PASSWORD}}
106-
ARTIFACTORY_USERNAME=${{secrets.ARTIFACTORY_USERNAME}}
105+
ARTIFACTORY_PASSWORD=${{ secrets.ARTIFACTORY_PASSWORD }}
106+
ARTIFACTORY_USERNAME=${{ secrets.ARTIFACTORY_USERNAME }}
107+
BUILD_DATE=${{ steps.prep.outputs.build-date }}
108+
BUILD_USER=${{ steps.prep.outputs.build-user }}
109+
GIT_BRANCH=${{ steps.prep.outputs.git-branch }}
110+
GIT_REVISION=${{ steps.prep.outputs.git-version }}
111+
VERSION=${{ steps.prep.outputs.version }}

0 commit comments

Comments
 (0)