From 31cdf06ace80279732b91f09b186723c7bd0ce93 Mon Sep 17 00:00:00 2001 From: kentsanggds Date: Mon, 7 Aug 2023 11:32:59 +0100 Subject: [PATCH] Build images with tags --- .github/workflows/ghcr.yaml | 3 +++ docker/build-image.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ghcr.yaml b/.github/workflows/ghcr.yaml index ce663170..6bb99844 100644 --- a/.github/workflows/ghcr.yaml +++ b/.github/workflows/ghcr.yaml @@ -16,6 +16,8 @@ on: push: branches: - main + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' schedule: - cron: '0 3 * * 0' @@ -62,4 +64,5 @@ jobs: VERSION: ${{ matrix.app.version }} ARCH: ${{ matrix.arch }} BUILD_BASE: ${{ inputs.buildBaseImages }} + GH_REF: ${{ github.ref_name }} run: ./docker/build-image.sh diff --git a/docker/build-image.sh b/docker/build-image.sh index 65ed26ba..cbd3bd01 100755 --- a/docker/build-image.sh +++ b/docker/build-image.sh @@ -18,7 +18,7 @@ if [[ ${BUILD_BASE:-} = "true" ]]; then DOCKER_TAG="${VERSION}" fi else - DOCKER_TAG="${GITHUB_SHA}" + DOCKER_TAG="${GH_REF}" fi if [[ -n ${DOCKER_TAG:-} ]]; then