1717 contents : read
1818 packages : write
1919
20+ strategy :
21+ fail-fast : false
22+ matrix :
23+ image :
24+ - name : api
25+ repository : ghcr.io/socialgouv/no-package-malware-api
26+ target : api-runtime
27+ - name : app
28+ repository : ghcr.io/socialgouv/no-package-malware-app
29+ target : app-runtime
30+ - name : registry
31+ repository : ghcr.io/socialgouv/no-package-malware-registry
32+ target : registry-runtime
33+
2034 steps :
2135 - name : Checkout repository
2236 uses : actions/checkout@v5
@@ -37,11 +51,11 @@ jobs:
3751 username : ${{ github.actor }}
3852 password : ${{ secrets.GITHUB_TOKEN }}
3953
40- - name : Extract metadata (tags, labels) for API image
41- id : meta-api
54+ - name : Extract metadata (tags, labels)
55+ id : meta
4256 uses : docker/metadata-action@v5
4357 with :
44- images : ghcr.io/socialgouv/no-package-malware-api
58+ images : ${{ matrix.image.repository }}
4559 tags : |
4660 type=schedule
4761 type=ref,event=branch
@@ -52,52 +66,14 @@ jobs:
5266 type=sha
5367 type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
5468
55- - name : Extract metadata (tags, labels) for App image
56- id : meta-app
57- uses : docker/metadata-action@v5
58- with :
59- images : ghcr.io/socialgouv/no-package-malware-app
60- tags : ${{ steps.meta-api.outputs.tags }}
61-
62- - name : Extract metadata (tags, labels) for Registry image
63- id : meta-registry
64- uses : docker/metadata-action@v5
65- with :
66- images : ghcr.io/socialgouv/no-package-malware-registry
67- tags : ${{ steps.meta-api.outputs.tags }}
68-
69- - name : Build and push API image
70- uses : docker/build-push-action@v6
71- with :
72- context : .
73- file : Dockerfile
74- target : api-runtime
75- push : true
76- tags : ${{ steps.meta-api.outputs.tags }}
77- labels : ${{ steps.meta-api.outputs.labels }}
78- build-args : |
79- VERSION=${{ steps.get_tag.outputs.GIT_TAG }}
80-
81- - name : Build and push App image
82- uses : docker/build-push-action@v6
83- with :
84- context : .
85- file : Dockerfile
86- target : app-runtime
87- push : true
88- tags : ${{ steps.meta-app.outputs.tags }}
89- labels : ${{ steps.meta-app.outputs.labels }}
90- build-args : |
91- VERSION=${{ steps.get_tag.outputs.GIT_TAG }}
92-
93- - name : Build and push Registry image
69+ - name : Build and push ${{ matrix.image.name }} image
9470 uses : docker/build-push-action@v6
9571 with :
9672 context : .
9773 file : Dockerfile
98- target : registry-runtime
74+ target : ${{ matrix.image.target }}
9975 push : true
100- tags : ${{ steps.meta-registry .outputs.tags }}
101- labels : ${{ steps.meta-registry .outputs.labels }}
76+ tags : ${{ steps.meta.outputs.tags }}
77+ labels : ${{ steps.meta.outputs.labels }}
10278 build-args : |
10379 VERSION=${{ steps.get_tag.outputs.GIT_TAG }}
0 commit comments