File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
9+ - name : " Install jq"
10+ uses : dcarbone/install-jq-action@v3
11+ with :
12+ version : ' 1.7.1'
1113 - name : Login to Docker Hub
1214 uses : docker/login-action@v3
1315 with :
1416 username : ${{ secrets.DOCKERHUB_USERNAME }}
1517 password : ${{ secrets.DOCKERHUB_TOKEN }}
1618 - name : Checkout code
1719 uses : actions/checkout@v4
18- - name : " Build and Push"
20+ - name : " Build images"
21+ 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
26+ - name : " Push Images"
1927 run : |
20- chmod +x ./versioning.sh
21- ./versioning.sh
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)
31+ done
32+
You can’t perform that action at this time.
0 commit comments