Add product version and build number to config (#135)

This commit is contained in:
Sergey Kirichenko 2024-02-19 10:30:49 +03:00 committed by GitHub
parent 5520b2e8f5
commit 627e61c44e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,14 +55,18 @@ jobs:
run: | run: |
cd .${DOCKER_PATH} cd .${DOCKER_PATH}
if [ "${{ matrix.branch }}" = "develop" ]; then if [ "${{ matrix.branch }}" = "develop" ]; then
DOCKER_TAG="develop.${{ github.run_number }}" PRODUCT_VERSION="develop"
DOCKER_TAG=${PRODUCT_VERSION}.${{ github.run_number }}
else else
DOCKER_TAG=$(echo "${{ matrix.branch }}" | sed '/^release\b\|^hotfix\b\|^feature\b/s/release.*\/\|hotfix.*\/\|feature.*\///; s/-git-action$//; s/^v//').${{github.run_number}} PRODUCT_VERSION=$(echo "${{ matrix.branch }}" | sed '/^release\b\|^hotfix\b\|^feature\b/s/release.*\/\|hotfix.*\/\|feature.*\///; s/-git-action$//; s/^v//')
DOCKER_TAG=${PRODUCT_VERSION}.${{github.run_number}}
fi fi
export DOCKER_TAG export DOCKER_TAG
docker buildx bake -f build.yml \ docker buildx bake -f build.yml \
--set *.args.GIT_BRANCH=${{ matrix.branch }} \ --set *.args.GIT_BRANCH=${{ matrix.branch }} \
--set *.platform=linux/amd64 \ --set *.platform=linux/amd64 \
--set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
--set *.args.BUILD_NUMBER=${BUILD_NUMBER} \
--push --push
echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT" echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT"