-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(service): extract the label part from what is returned by the met…
…adata action (#71) Signed-off-by: Sven Trieflinger <[email protected]>
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,12 +68,20 @@ jobs: | |
uses: imjasonh/[email protected] | ||
- name: Publish Docker Images | ||
run: | | ||
# Generate tags flag | ||
# Generate tags flag (Metadata action output is newline delimited entries like | ||
# 'ghcr.io/carbynestack/ephemeral:0.1.10' and we only need the part after the colon) | ||
readarray -t tags < <( echo "${{ steps.meta.outputs.tags }}" ) | ||
for i in "${!tags[@]}"; do | ||
readarray -d ":" -t parts < <( echo "${tags[i]}" ) | ||
tags[i]=$(echo "${parts[1]}" | tr -d '\n') | ||
done | ||
printf -v joined_tags "%s," "${tags[@]}" | ||
# Generate label flags | ||
readarray -t labels < <( echo "${{ steps.meta.outputs.labels }}" ) | ||
printf -v label_flags -- "--image-label=%s " "${labels[@]}" | ||
# Publish using ko | ||
ko publish -B \ | ||
--tags="${joined_tags%,}" \ | ||
"${label_flags}" \ | ||
|