From 39b82a3c9a6e1ea6b487b8719101060454e124fd Mon Sep 17 00:00:00 2001 From: danilapog Date: Thu, 24 Apr 2025 14:17:08 +0300 Subject: [PATCH] build: add conditional tagging for latest in stable-build workflow - Introduced input in the GitHub Actions workflow with a default value of . - Passed the input as an environment variable () to the workflow. - Updated to conditionally add the Docker tag based on value. --- .github/workflows/stable-build.yml | 6 ++++++ docker-bake.hcl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index 01e80f7..b89b847 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -14,12 +14,18 @@ on: type: string required: true default: '1' + latest: + description: 'Push latest tag?' + type: boolean + required: true + default: true env: COMPANY_NAME: "onlyoffice" PRODUCT_NAME: "documentserver" VERSION: ${{ github.event.inputs.tag }} RELEASE_NUMBER: ${{ github.event.inputs.release_number }} + LATEST: ${{ github.event.inputs.latest }} jobs: build: diff --git a/docker-bake.hcl b/docker-bake.hcl index 7db339c..9eab0de 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -110,7 +110,7 @@ target "documentserver-stable" { tags = ["docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}", "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTER_TAG}", "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${SHORTEST_TAG}", - "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:latest", + equal("true",LATEST) ? "docker.io/${COMPANY_NAME}/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:latest": "", equal("-ee",PRODUCT_EDITION) ? "docker.io/${COMPANY_NAME}4enterprise/${PREFIX_NAME}${PRODUCT_NAME}${PRODUCT_EDITION}:${TAG}": "",] platforms = ["linux/amd64", "linux/arm64"] args = {