Skip to content

Commit

Permalink
Fix dock_image
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Oct 27, 2023
1 parent c4efc56 commit 82fb223
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ jobs:
run: |
import os
import itertools
def join_tag(t):
registry, repo, tag = t
return f'{registry}/{repo}:{tag}'.lower()
registries = ['docker.io', 'ghcr.io']
repos = ['${{ github.repository }}']
if '${{ github.ref_type }}' == 'branch':
Expand All @@ -65,16 +69,17 @@ jobs:
else:
tags = []
def join_tag(t):
registry, repo, tag = t
return f'{registry}/{repo}:{tag}'.lower()
if '${{ github.ref_type }}' == 'tag':
local_tag = join_tag(('ghcr.io', '${{ github.repository }}', version))
else:
local_tag = join_tag(('localhost', '${{ github.repository }}', 'latest'))
product = itertools.product(registries, repos, tags)
tags_csv = ','.join(map(join_tag, product))
outputs = {
'tags_csv' : tags_csv,
'push' : 'true' if tags_csv else 'false',
'local_tag': join_tag(('localhost', '${{ github.repository }}', 'latest'))
'local_tag': local_tag
}
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
for k, v in outputs.items():
Expand Down

0 comments on commit 82fb223

Please sign in to comment.