@@ -11,24 +11,27 @@ jobs:
11
11
docker-hub :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
- -
15
- name : Checkout
14
+ - name : Checkout
16
15
uses : actions/checkout@v4
17
- -
18
- name : Login to Docker Hub
16
+
17
+ - name : Set up QEMU
18
+ uses : docker/setup-qemu-action@v3
19
+
20
+ - name : Set up Docker Buildx
21
+ uses : docker/setup-buildx-action@v3
22
+
23
+ - name : Login to Docker Hub
19
24
uses : docker/login-action@v3
20
25
with :
21
26
username : xcsoft
22
27
password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
23
- -
24
- name : Set up Docker Build Context
25
- uses : docker/setup-buildx-action@v3
26
- -
27
- name : Build and push
28
+
29
+ - name : Build and push multi-arch
28
30
uses : docker/build-push-action@v5
29
31
with :
30
32
context : .
31
33
file : ./Dockerfile
34
+ platforms : linux/amd64,linux/arm64 # 关键修改:同时构建两个架构
32
35
push : true
33
36
tags : |
34
37
xcsoft/busuanzi:${{ github.ref_name }}
@@ -40,22 +43,26 @@ jobs:
40
43
- name : Checkout
41
44
uses : actions/checkout@v4
42
45
43
- - name : Login to Docker Hub
46
+ - name : Set up QEMU
47
+ uses : docker/setup-qemu-action@v3
48
+
49
+ - name : Set up Docker Buildx
50
+ uses : docker/setup-buildx-action@v3
51
+
52
+ - name : Login to GitHub Container Registry
44
53
if : github.event_name != 'pull_request'
45
54
uses : docker/login-action@v1
46
55
with :
47
56
registry : ghcr.io
48
57
username : ${{ github.actor }}
49
58
password : ${{ secrets.GITHUB_TOKEN }}
50
59
51
- - name : Set up Docker Build Context
52
- uses : docker/setup-buildx-action@v3
53
-
54
- - name : Build and push
60
+ - name : Build and push multi-arch
55
61
uses : docker/build-push-action@v5
56
62
with :
57
63
context : .
58
64
file : ./Dockerfile
65
+ platforms : linux/amd64,linux/arm64
59
66
push : true
60
67
tags : |
61
68
ghcr.io/soxft/busuanzi:${{ github.ref_name }}
0 commit comments