Skip to content

Commit 87b7ab4

Browse files
committed
✅ test: try Github Action ARM docker tag
1 parent 871cbe9 commit 87b7ab4

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

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

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,59 @@ jobs:
1010
docker-hub:
1111
runs-on: ubuntu-latest
1212
steps:
13-
-
14-
name: Checkout
13+
- name: Checkout
1514
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
1823
uses: docker/login-action@v3
1924
with:
2025
username: xcsoft
2126
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
2729
uses: docker/build-push-action@v5
2830
with:
2931
context: .
3032
file: ./Dockerfile
33+
platforms: linux/amd64,linux/arm64 # 关键修改:同时构建两个架构
3134
push: true
3235
tags: |
3336
xcsoft/busuanzi:${{ github.ref_name }}
37+
xcsoft/busuanzi:latest
3438
3539
github-docker:
3640
runs-on: ubuntu-latest
3741
steps:
3842
- name: Checkout
3943
uses: actions/checkout@v4
4044

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
4252
if: github.event_name != 'pull_request'
4353
uses: docker/login-action@v1
4454
with:
4555
registry: ghcr.io
4656
username: ${{ github.actor }}
4757
password: ${{ secrets.GITHUB_TOKEN }}
4858

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
5460
uses: docker/build-push-action@v5
5561
with:
5662
context: .
5763
file: ./Dockerfile
64+
platforms: linux/amd64,linux/arm64
5865
push: true
5966
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

Comments
 (0)