File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ name: docker
22
33permissions :
44 contents : read
5+ packages : read
56
67on :
78 workflow_dispatch :
1011 - ' .github/**'
1112 - ' backend/**'
1213 - ' frontend/**'
14+ - ' Dockerfile'
1315 - ' docker-compose.yml'
1416 push :
1517 branches :
1820jobs :
1921 build-and-push-image :
2022 runs-on : ubuntu-24.04
21- permissions :
22- contents : read
23- packages : read
2423
2524 steps :
2625 - name : Checkout repository
3534 context : frontend
3635 push : false
3736 file : frontend/Dockerfile
38- tags : ${{ steps.meta_frontend.outputs.tags }}
39- labels : ${{ steps.meta_frontend.outputs.labels }}
4037 # Don't build linux/arm64/v8 because it's very slow with QEMU
4138 platforms : linux/amd64
4239
4643 context : backend
4744 push : false
4845 file : backend/Dockerfile
49- tags : ${{ steps.meta_backend.outputs.tags }}
50- labels : ${{ steps.meta_backend.outputs.labels }}
46+ # Don't build linux/arm64/v8 because it's very slow with QEMU
47+ platforms : linux/amd64
48+
49+ - name : Build combined Docker image
50+ uses : docker/build-push-action@v6
51+ with :
52+ context : ./
53+ push : false
54+ file : Dockerfile
5155 # Don't build linux/arm64/v8 because it's very slow with QEMU
5256 platforms : linux/amd64
Original file line number Diff line number Diff line change 1313 REGISTRY : ghcr.io
1414 IMAGE_NAME_FRONTEND : ${{ github.repository }}-frontend
1515 IMAGE_NAME_BACKEND : ${{ github.repository }}-backend
16+ IMAGE_NAME_COMBINED : ${{ github.repository }}
1617
1718jobs :
1819 build-and-push-image :
5051 with :
5152 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}
5253
54+ - name : Extract metadata (tags, labels) for combined Docker image
55+ id : meta_combined
56+ uses : docker/metadata-action@v5
57+ with :
58+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_COMBINED }}
59+
5360 - name : Build and push frontend Docker image
5461 uses : docker/build-push-action@v6
5562 with :
6976 tags : ${{ steps.meta_backend.outputs.tags }}
7077 labels : ${{ steps.meta_backend.outputs.labels }}
7178 platforms : linux/amd64,linux/arm64/v8
79+
80+ - name : Build and push combined Docker image
81+ uses : docker/build-push-action@v6
82+ with :
83+ context : ./
84+ push : true
85+ file : Dockerfile
86+ tags : ${{ steps.meta_combined.outputs.tags }}
87+ labels : ${{ steps.meta_combined.outputs.labels }}
88+ platforms : linux/amd64,linux/arm64/v8
You can’t perform that action at this time.
0 commit comments