Skip to content

Commit

Permalink
Need to pass in build args to Dockerfile
Browse files Browse the repository at this point in the history
Missing things like GIT_BRANCH and BUILD_DATE
  • Loading branch information
xbglowx committed Aug 10, 2023
1 parent 846bb6f commit d902119
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
id: prep
run: |
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)
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
Expand All @@ -35,8 +35,8 @@ jobs:
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
# Tag with both registries GHCR and
# Tag with both registries GHCR and
if [ '${{ github.event_name != 'pull_request' }}' == 'true' ]; then
# release to all registries
GHCR=ghcr.io/${GITHUB_REPOSITORY,,}
Expand All @@ -47,8 +47,8 @@ jobs:
ARTIFACTORY="docker-builds.pennywise.cc/${GITHUB_REPOSITORY,,}"
TAGS="$ARTIFACTORY:$ML_PROJECT_VERSION"
fi
# outputs
# outputs
for out in "version=${VERSION}" "tags=${TAGS}" "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"; do
# echo "k=v" >> $GITHUB_OUTPUT
echo $out | tee >(cat) >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -104,3 +104,8 @@ jobs:
build-args: |
ARTIFACTORY_PASSWORD=${{secrets.ARTIFACTORY_PASSWORD}}
ARTIFACTORY_USERNAME=${{secrets.ARTIFACTORY_USERNAME}}
BUILD_DATE=$(date +%Y%m%d-%H:%M:%S)
BUILD_USER=$(whoami)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_REVISION=$(git rev-parse HEAD)
VERSION=$(cat VERSION)

0 comments on commit d902119

Please sign in to comment.