Skip to content

Commit 56af0ad

Browse files
committed
💚 now github action support arm arch
1 parent 87b7ab4 commit 56af0ad

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

.github/workflows/docker-push-rc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
push: true
3535
tags: |
3636
xcsoft/busuanzi:${{ github.ref_name }}
37-
xcsoft/busuanzi:latest
3837
3938
github-docker:
4039
runs-on: ubuntu-latest
@@ -64,5 +63,4 @@ jobs:
6463
platforms: linux/amd64,linux/arm64
6564
push: true
6665
tags: |
67-
ghcr.io/soxft/busuanzi:${{ github.ref_name }}
68-
ghcr.io/soxft/busuanzi:latest
66+
ghcr.io/soxft/busuanzi:${{ github.ref_name }}

.github/workflows/docker-push.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,27 @@ jobs:
1111
docker-hub:
1212
runs-on: ubuntu-latest
1313
steps:
14-
-
15-
name: Checkout
14+
- name: Checkout
1615
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
1924
uses: docker/login-action@v3
2025
with:
2126
username: xcsoft
2227
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
2830
uses: docker/build-push-action@v5
2931
with:
3032
context: .
3133
file: ./Dockerfile
34+
platforms: linux/amd64,linux/arm64 # 关键修改:同时构建两个架构
3235
push: true
3336
tags: |
3437
xcsoft/busuanzi:${{ github.ref_name }}
@@ -40,22 +43,26 @@ jobs:
4043
- name: Checkout
4144
uses: actions/checkout@v4
4245

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
4453
if: github.event_name != 'pull_request'
4554
uses: docker/login-action@v1
4655
with:
4756
registry: ghcr.io
4857
username: ${{ github.actor }}
4958
password: ${{ secrets.GITHUB_TOKEN }}
5059

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
5561
uses: docker/build-push-action@v5
5662
with:
5763
context: .
5864
file: ./Dockerfile
65+
platforms: linux/amd64,linux/arm64
5966
push: true
6067
tags: |
6168
ghcr.io/soxft/busuanzi:${{ github.ref_name }}

0 commit comments

Comments
 (0)