Skip to content

Commit a7bb88b

Browse files
committed
feat: matrix
1 parent 0c02451 commit a7bb88b

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

.github/workflows/docker-build-publish-demo.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ on:
88

99
jobs:
1010

11-
ocap-api:
12-
11+
build:
1312
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
service:
17+
- { name: "ocap-api", context: ".deploy/api", image_name: "ocap-api-demo" }
18+
- { name: "ocap-webapp", context: ".deploy/webapp", image_name: "ocap-webapp-demo" }
1419

1520
steps:
1621
- uses: actions/checkout@v4
@@ -21,12 +26,12 @@ jobs:
2126
username: ${{ secrets.DOCKERHUB_USERNAME }}
2227
password: ${{ secrets.DOCKERHUB_TOKEN }}
2328

24-
- name: Login to GitHub Container Registry
25-
uses: docker/login-action@v3
26-
with:
27-
registry: ghcr.io
28-
username: ${{ github.repository_owner }}
29-
password: ${{ secrets.GITHUB_TOKEN }}
29+
# - name: Login to GitHub Container Registry
30+
# uses: docker/login-action@v3
31+
# with:
32+
# registry: ghcr.io
33+
# username: ${{ github.repository_owner }}
34+
# password: ${{ secrets.GITHUB_TOKEN }}
3035

3136
- uses: aliyun/acr-login@v1
3237
with:
@@ -45,13 +50,12 @@ jobs:
4550
with:
4651
platforms: linux/amd64,linux/arm64
4752
context: .
48-
file: ./.deploy/api/Dockerfile
53+
file: ${{ matrix.service.context }}/Dockerfile
4954
push: true
5055
tags: |
51-
metadc/ocap-api-demo:latest
52-
ghcr.io/meta-d/ocap-api-demo:latest
53-
registry.cn-hangzhou.aliyuncs.com/metad/ocap-api-demo:latest
54-
cache-from: type=registry,ref=metadc/ocap-api-demo:latest
56+
metadc/${{ matrix.service.image_name }}:latest
57+
registry.cn-hangzhou.aliyuncs.com/metad/${{ matrix.service.image_name }}:latest
58+
cache-from: type=registry,ref=metadc/${{ matrix.service.image_name }}:latest
5559
cache-to: type=inline
5660

5761
- name: Docker images list

0 commit comments

Comments
 (0)