Skip to content

Commit 96ea239

Browse files
author
Felipe Almeida Baccaro
committed
fixing jq command docker-image.yml.
1 parent 4af7f8c commit 96ea239

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ jobs:
66
build_and_push:
77
runs-on: ubuntu-22.04
88
steps:
9+
- name: "Update Jq"
10+
run: sudo apt-get install --only-upgrade jq
911
- name: Login to Docker Hub
1012
uses: docker/login-action@v3
1113
with:
@@ -15,13 +17,13 @@ jobs:
1517
uses: actions/checkout@v4
1618
- name: "Build images"
1719
run: |
18-
buildExpr='map(select(.build == true)).[] | .stages[] as $stage | "docker build \-\-no-cache \-\-target \($stage) \-t \(.namespace)/\(.name):\(.tag)\-\($stage|ascii_downcase) ./\(.path)" | split("\n") | .[]';
20+
buildExpr='map(select(.build == true)).[] | .stages[] as $stage | "docker build --no-cache --target \($stage) -t \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) ./\(.path)" | split("\n") | .[]';
1921
jq -r "$buildExpr" versions.json | while read -r image; do
2022
$($image)
2123
done
2224
- name: "Push Images"
2325
run: |
24-
pushExpr='map(select(.build == true and .push == true)).[] | .stages[] as $stage | "docker push \(.namespace)/\(.name):\(.tag)\-\($stage|ascii_downcase) " | split("\n") | .[]'
26+
pushExpr='map(select(.build == true and .push == true)).[] | .stages[] as $stage | "docker push \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) " | split("\n") | .[]'
2527
jq -r "$pushExpr" versions.json | while read -r image; do
2628
$($image)
2729
done

0 commit comments

Comments
 (0)