Skip to content

Commit

Permalink
Merge pull request #122 from betadots/fix_container_tagging
Browse files Browse the repository at this point in the history
simplify tagging
  • Loading branch information
rwaffen authored Dec 15, 2022
2 parents d3904b1 + 6ca67b2 commit a99aa7c
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,11 @@ jobs:
version = "${{ github.ref }}".replace("refs/tags/v", "")
image = "ghcr.io/${{ github.repository }}"
tags = set()
# full version
if not version == 'refs/heads/main':
tags.add(f"{image}:{version}")
if version == 'refs/heads/main':
tags.add(f"{image}:development")
if not parse(version).is_prerelease:
# only final and post-releases should get the tags
# used for automatic use of latest *stable* version
# major_version
if not version == 'refs/heads/main':
major_version = re.search(r'(\d+?)\.', version).group(1)
tags.add(f"{image}:{major_version}")
# major_version.minor_version
major_and_minor_version = re.search(r'(\d+?\.\d+?)\.', version).group(1)
tags.add(f"{image}:{major_and_minor_version}")
else:
tags.add(f"{image}:{version}")
if not parse(version).is_prerelease:
tags.add(f"{image}:latest")
tags = ",".join(sorted(list(tags)))
print(f"::set-output name=tags::{tags}")
Expand Down

0 comments on commit a99aa7c

Please sign in to comment.