1- name : " Release "
1+ name : " Build and Publish "
22
33on :
44 release :
@@ -16,36 +16,96 @@ jobs:
1616 DOCKERHUB_REPO : " otel/demo"
1717 GHCR_REPO : " ghcr.io/open-telemetry/demo"
1818
19+ strategy :
20+ matrix :
21+ file_tag :
22+ - file : ./src/adservice/Dockerfile
23+ tag_suffix : adservice
24+ context : ./
25+ - file : ./src/cartservice/src/Dockerfile
26+ tag_suffix : cartservice
27+ context : ./
28+ - file : ./src/checkoutservice/Dockerfile
29+ tag_suffix : checkoutservice
30+ context : ./
31+ - file : ./src/currencyservice/Dockerfile
32+ tag_suffix : currencyservice
33+ context : ./src/currencyservice
34+ - file : ./src/emailservice/Dockerfile
35+ tag_suffix : emailservice
36+ context : ./src/emailservice
37+ - file : ./src/frontend/Dockerfile
38+ tag_suffix : frontend
39+ context : ./
40+ - file : ./src/frontendproxy/Dockerfile
41+ tag_suffix : frontendproxy
42+ context : ./
43+ - file : ./src/paymentservice/Dockerfile
44+ tag_suffix : paymentservice
45+ context : ./
46+ - file : ./src/productcatalogservice/Dockerfile
47+ tag_suffix : productcatalogservice
48+ context : ./
49+ - file : ./src/quoteservice/Dockerfile
50+ tag_suffix : quoteservice
51+ context : ./
52+ - file : ./src/shippingservice/Dockerfile
53+ tag_suffix : shippingservice
54+ context : ./
55+ - file : ./src/featureflagservice/Dockerfile
56+ tag_suffix : featureflagservice
57+ context : ./src/featureflagservice
58+ - file : ./src/loadgenerator/Dockerfile
59+ tag_suffix : loadgenerator
60+ context : ./
61+ - file : ./src/recommendationservice/Dockerfile
62+ tag_suffix : recommendationservice
63+ context : ./
64+ - file : ./src/frontend/Dockerfile.cypress
65+ tag_suffix : frontend-tests
66+ context : ./
67+ - file : ./test/Dockerfile
68+ tag_suffix : integrationTests
69+ context : ./
1970 steps :
2071 - uses : actions/checkout@v3
2172 with :
2273 fetch-depth : 0
2374
24- # limit docker push image concurrency to 1
25- # to avoid github package return 429 ratelimit error
26- - name : Set docker upload concurrent
27- run : |
28- echo $'{"max-concurrent-uploads": 1}' | sudo dd status=none of=/etc/docker/daemon.json
29- sudo service docker restart
30-
3175 - name : Log in to the Container registry
3276 uses : docker/login-action@v2
3377 with :
3478 registry : ghcr.io
3579 username : ${{ github.repository_owner }}
3680 password : ${{ secrets.GITHUB_TOKEN }}
81+ if : github.event_name != 'pull_request'
3782
3883 - name : Log in to Docker Hub
3984 uses : docker/login-action@v2
4085 with :
4186 username : ${{ secrets.DOCKER_USERNAME }}
4287 password : ${{ secrets.DOCKER_PASSWORD }}
88+ if : github.event_name != 'pull_request'
4389
44- - name : prepare build env
45- run : make build-env-file
90+ - name : Set up QEMU
91+ uses : docker/setup-qemu-action@v2
4692
47- - name : build and push ghcr docker image
48- run : make build-and-push-ghcr
93+ - name : Set up Docker Buildx
94+ uses : docker/setup-buildx-action@v2
95+ with :
96+ config-inline : |
97+ [worker.oci]
98+ max-parallelism = 2
4999
50- - name : build and push dockerhub image
51- run : make build-and-push-dockerhub
100+ - name : Matrix Build and push demo images
101+ 102+ with :
103+ context : ${{ matrix.file_tag.context }}
104+ file : ${{ matrix.file_tag.file }}
105+ platforms : linux/amd64
106+ push : ${{ github.event_name != 'pull_request' }}
107+ tags : |
108+ ${{ env.DOCKERHUB_REPO }}:${{ env.RELEASE_VERSION || 'pr' }}-${{matrix.file_tag.tag_suffix }}
109+ ${{ env.GHCR_REPO }}:${{ env.RELEASE_VERSION || 'pr' }}-${{ matrix.file_tag.tag_suffix }}
110+ cache-from : type=gha
111+ cache-to : type=gha
0 commit comments