Skip to content

Commit c994216

Browse files
author
Felipe Almeida Baccaro
committed
trying to make GitHub action work.
1 parent c027d4b commit c994216

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches: [ "master" ]
55
jobs:
6-
build_and_push:
6+
build:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Login to Docker Hub
@@ -14,4 +14,20 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616
- name: "Build images"
17-
run: jq --version
17+
if: success()
18+
run: |
19+
jq -r 'map(select(.build == true)).[]
20+
| .stages[] as $stage
21+
| "docker build --no-cache --target \($stage) -t \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase) ./\(.path) "
22+
| split("\n") | .[]' versions.json | while read -r image; do
23+
$($image);
24+
done
25+
- name: "Push images"
26+
if: success()
27+
run: |
28+
jq -r 'map(select(.build == true and .push == true)).[]
29+
| .stages[] as $stage
30+
| "docker push \(.namespace)/\(.repository):\(.tag)-\($stage|ascii_downcase)"
31+
| split("\n") | .[]' versions.json | while read -r image; do
32+
$($image);
33+
done

0 commit comments

Comments
 (0)