Skip to content

Commit dd8341d

Browse files
author
Felipe Almeida Baccaro
committed
dcarbone/install-jq-action github action.
1 parent bba56c0 commit dd8341d

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

‎.github/workflows/docker-image.yml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ jobs:
1919
uses: actions/checkout@v4
2020
- name: "Build images"
2121
run: |
22-
buildExpr='map(select(.build == true)).[] | .stages[] as $stage | "docker build --no-cache --target \($stage) -t \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase) ./\(.path)" | split("\n") | .[]';
23-
jq -r "$buildExpr" versions.json | while read -r image; do
24-
$($image)
25-
done
22+
jq -r 'map(select(.build == true)).[]
23+
| .stages[] as $stage
24+
| "docker build --no-cache --target \($stage) -t \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase) ./\(.path) "
25+
| split("\n") | .[]' versions.json | while read -r image; do
26+
$("$image")
27+
done
2628
- name: "Push Images"
2729
run: |
28-
pushExpr='map(select(.build == true and .push == true)).[] | .stages[] as $stage | "docker push \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase) " | split("\n") | .[]'
29-
jq -r "$pushExpr" versions.json | while read -r image; do
30-
$($image)
30+
jq -r 'map(select(.build == true and .push == true)).[]
31+
| .stages[] as $stage
32+
| "docker push \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase)"
33+
| split("\n") | .[]' versions.json | while read -r image; do
34+
$("$image")
3135
done
3236

0 commit comments

Comments
 (0)