From bdc36af9a992ad5f586fcf710663d8269073cc0c Mon Sep 17 00:00:00 2001 From: na <85711060+nuovamaila@users.noreply.github.com> Date: Mon, 18 Aug 2025 17:49:10 +0200 Subject: [PATCH] Add semantic versioning for the docker images (#215) For every push of a tag, create an image with the same tag. This was also mentioned in [Semantic versioning for the docker container #68 ](https://github.com/calibrain/calibre-web-automated-book-downloader/issues/68) --------- Co-authored-by: CaliBrain --- .../workflows/build-and-publish-docker-image.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish-docker-image.yml b/.github/workflows/build-and-publish-docker-image.yml index e7a0f591..14b5097e 100644 --- a/.github/workflows/build-and-publish-docker-image.yml +++ b/.github/workflows/build-and-publish-docker-image.yml @@ -2,7 +2,13 @@ name: Create and publish Docker images on: push: - branches: ['main'] + branches: + - 'main' + tags: + - 'v*' + pull_request: + branches: + - 'main' workflow_dispatch: env: @@ -38,7 +44,8 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=latest,enable={{is_default_branch}} - type=raw,value={{commit_date 'YYYYMMDD'}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} type=sha type=ref,event=branch type=ref,event=tag @@ -74,7 +81,8 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-tor tags: | type=raw,value=latest,enable={{is_default_branch}} - type=raw,value={{commit_date 'YYYYMMDD'}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} type=sha type=ref,event=branch type=ref,event=tag