Skip to content

Commit

Permalink
its not main its refs/heads/main
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaffen committed Sep 13, 2022
1 parent 9800ee5 commit d201724
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ jobs:
from packaging.version import parse
version = "${{ github.ref }}".replace("refs/tags/v", "")
print(version)
# image = "ghcr.io/${{ github.repository }}"
# tags = set()
# # full version
# tags.add(f"{image}:{version}")
# if version == '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 == '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}")
# tags.add(f"{image}:latest")
# tags = ",".join(sorted(list(tags)))
# print(f"::set-output name=tags::{tags}")
image = "ghcr.io/${{ github.repository }}"
tags = set()
# full version
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}")
tags.add(f"{image}:latest")
tags = ",".join(sorted(list(tags)))
print(f"::set-output name=tags::{tags}")
id: tags

- name: Build and push
Expand Down

0 comments on commit d201724

Please sign in to comment.