Skip to content

Commit 72e3e34

Browse files
committed
docker: built multiplaforms
1 parent aba24d5 commit 72e3e34

File tree

1 file changed

+18
-70
lines changed

1 file changed

+18
-70
lines changed

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

Lines changed: 18 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -14,85 +14,34 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Build
18-
uses: docker/build-push-action@v6.3.0
19-
with:
20-
context: .
21-
file: ./.deploy/api/Dockerfile
22-
load: true
23-
platforms: linux/amd64
24-
tags: |
25-
ghcr.io/meta-d/ocap-api-demo:latest
26-
metadc/ocap-api-demo:latest
27-
registry.cn-hangzhou.aliyuncs.com/metad/ocap-api-demo:latest
28-
cache-from: type=registry,ref=metadc/ocap-api-demo:latest
29-
cache-to: type=inline
30-
- name: Docker images list
31-
run: |
32-
sudo docker image list
33-
17+
3418
- name: Login to DockerHub
35-
uses: docker/login-action@v3.2.0
19+
uses: docker/login-action@v3
3620
with:
3721
username: ${{ secrets.DOCKERHUB_USERNAME }}
3822
password: ${{ secrets.DOCKERHUB_TOKEN }}
3923

40-
- name: Push to Docker Hub Registry
41-
run: |
42-
docker push metadc/ocap-api-demo:latest
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
4326

44-
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v3.2.0
46-
with:
47-
registry: ghcr.io
48-
username: ${{ github.repository_owner }}
49-
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
5029

51-
- name: Push to Github Registry
52-
run: |
53-
docker push ghcr.io/meta-d/ocap-api-demo:latest
54-
55-
- uses: aliyun/acr-login@v1
30+
- name: Build and push
31+
uses: docker/build-push-action@v6
5632
with:
57-
login-server: https://registry.cn-hangzhou.aliyuncs.com
58-
username: "${{ secrets.ACR_USERNAME }}"
59-
password: "${{ secrets.ACR_PASSWORD }}"
60-
61-
- name: Push to Aliyun Registry
62-
run: |
63-
docker push registry.cn-hangzhou.aliyuncs.com/metad/ocap-api-demo:latest
64-
65-
ocap-webapp:
66-
67-
runs-on: ubuntu-latest
33+
platforms: linux/amd64,linux/arm64
34+
context: .
35+
file: ./.deploy/api/Dockerfile
36+
push: true
37+
tags: |
38+
metadc/ocap-api-demo:latest
39+
cache-from: type=registry,ref=metadc/ocap-api-demo:latest
40+
cache-to: type=inline
6841

69-
steps:
70-
- uses: actions/checkout@v4
71-
- name: Build
72-
uses: docker/build-push-action@v6.3.0
73-
with:
74-
context: .
75-
file: ./.deploy/webapp/Dockerfile
76-
load: true
77-
platforms: linux/amd64
78-
tags: |
79-
ghcr.io/meta-d/ocap-webapp-demo:latest
80-
metadc/ocap-webapp-demo:latest
81-
registry.cn-hangzhou.aliyuncs.com/metad/ocap-webapp-demo:latest
82-
cache-from: type=registry,ref=metadc/ocap-webapp-demo:latest
83-
cache-to: type=inline
8442
- name: Docker images list
8543
run: |
8644
sudo docker image list
87-
- name: Login to DockerHub
88-
uses: docker/login-action@v3.2.0
89-
with:
90-
username: ${{ secrets.DOCKERHUB_USERNAME }}
91-
password: ${{ secrets.DOCKERHUB_TOKEN }}
92-
93-
- name: Push to Docker Hub Registry
94-
run: |
95-
docker push metadc/ocap-webapp-demo:latest
9645
9746
- name: Login to GitHub Container Registry
9847
uses: docker/login-action@v3.2.0
@@ -103,7 +52,7 @@ jobs:
10352

10453
- name: Push to Github Registry
10554
run: |
106-
docker push ghcr.io/meta-d/ocap-webapp-demo:latest
55+
docker push ghcr.io/meta-d/ocap-api-demo:latest
10756
10857
- uses: aliyun/acr-login@v1
10958
with:
@@ -113,5 +62,4 @@ jobs:
11362

11463
- name: Push to Aliyun Registry
11564
run: |
116-
docker push registry.cn-hangzhou.aliyuncs.com/metad/ocap-webapp-demo:latest
117-
65+
docker push registry.cn-hangzhou.aliyuncs.com/metad/ocap-api-demo:latest

0 commit comments

Comments
 (0)