Skip to content

Commit ed43c76

Browse files
committed
ci: fix docker image cleaning
1 parent c29d1ef commit ed43c76

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/docker-build.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Push Backend Image
1+
name: Build and Push Images
22

33
on:
44
push:
@@ -8,6 +8,15 @@ on:
88
jobs:
99
build-and-push:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
include:
14+
- name: backend
15+
context: backend
16+
package: modai-chat-backend
17+
- name: frontend
18+
context: frontend_omni
19+
package: modai-chat-frontend
1120
permissions:
1221
contents: read
1322
packages: write
@@ -28,14 +37,14 @@ jobs:
2837
id: meta
2938
uses: docker/metadata-action@v5
3039
with:
31-
images: ghcr.io/${{ github.repository_owner }}/modai-chat-backend
40+
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.package }}
3241
tags: |
3342
type=raw,value=latest
3443
3544
- name: Build and push Docker image
3645
uses: docker/build-push-action@v6
3746
with:
38-
context: backend
47+
context: ${{ matrix.context }}
3948
push: true
4049
tags: ${{ steps.meta.outputs.tags }}
4150
labels: ${{ steps.meta.outputs.labels }}
@@ -46,10 +55,18 @@ jobs:
4655
name: Cleanup Untagged Images
4756
runs-on: ubuntu-latest
4857
needs: build-and-push
58+
strategy:
59+
matrix:
60+
include:
61+
- name: backend
62+
package: modai-chat-backend
63+
- name: frontend
64+
package: modai-chat-frontend
4965
permissions:
5066
packages: write
5167
steps:
5268
- name: Delete untagged images
5369
uses: dataaxiom/ghcr-cleanup-action@v1
5470
with:
5571
delete-untagged: true
72+
package: ${{ matrix.package }}

0 commit comments

Comments
 (0)