@@ -16,48 +16,30 @@ jobs:
1616 permissions :
1717 contents : read
1818 packages : write
19- attestations : write
20- id-token : write
21- strategy :
22- matrix :
23- include :
24- - image : server
25- dockerfile : ./Dockerfile
26- image-name : ${{ github.repository }}
27- - image : client
28- dockerfile : ./Dockerfile.client
29- image-name : ${{ github.repository }}-client
3019 steps :
3120 - name : Checkout
3221 uses : actions/checkout@v4
22+
23+ - name : Set up QEMU
24+ uses : docker/setup-qemu-action@v3
25+
3326 - name : Set up Docker Buildx
3427 uses : docker/setup-buildx-action@v3
28+
3529 - name : Login to Container Registry
3630 uses : docker/login-action@v3
3731 with :
3832 registry : ${{ env.REGISTRY }}
3933 username : ${{ github.actor }}
4034 password : ${{ secrets.GITHUB_TOKEN }}
41- - name : Extract metadata (tags, labels)
42- id : meta
43- uses : docker/metadata-action@v5
44- with :
45- images : ${{ env.REGISTRY }}/${{ matrix.image-name }}
46- tags : |
47- type=ref,event=branch
48- type=ref,event=pr
49- type=semver,pattern={{raw}}
50- type=raw,value=latest,enable={{is_default_branch}}
51- - name : Build and push ${{ matrix.image }} image
52- uses : docker/build-push-action@v5
53- with :
54- context : .
55- file : ${{ matrix.dockerfile }}
56- platforms : linux/amd64,linux/arm64
57- push : true
58- tags : ${{ steps.meta.outputs.tags }}
59- labels : ${{ steps.meta.outputs.labels }}
60- build-args : |
61- VERSION=${{ github.ref_type == 'tag' && github.ref_name || 'dev' }}
62- attestations : type=provenance,mode=max
63- provenance : false
35+
36+ - name : Build and push Docker images
37+ run : |
38+ if [ "${{ github.event_name }}" == "pull_request" ]; then
39+ echo "Building images for PR (no push)"
40+ make docker-build
41+ make docker-build-client
42+ else
43+ echo "Building and pushing images"
44+ make docker-push
45+ fi
0 commit comments