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