Skip to content

Commit 57f2e27

Browse files
committed
Update xiuxian-game.yml
1 parent bbd62af commit 57f2e27

File tree

1 file changed

+44
-9
lines changed

1 file changed

+44
-9
lines changed

.github/workflows/xiuxian-game.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,38 @@ on:
66
- main
77

88
jobs:
9-
build:
9+
build-amd64:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
1313
packages: write
14-
1514
steps:
1615
- name: 检查代码
1716
uses: actions/checkout@v2
1817

19-
- name: 设置QEMU
20-
uses: docker/setup-qemu-action@v2
18+
- name: 登录 GitHub Container Registry
19+
uses: docker/login-action@v2
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GHCR_TOKEN }}
2124

22-
- name: 设置Docker Buildx
23-
uses: docker/setup-buildx-action@v2
25+
- name: 构建并推送 amd64 Docker镜像
26+
uses: docker/build-push-action@v3
2427
with:
25-
platforms: linux/amd64,linux/arm64
28+
context: .
29+
platforms: linux/amd64
30+
push: true
31+
tags: ghcr.io/${{ github.repository_owner }}/vue-xiuxiangame:amd64-latest
32+
33+
build-arm64:
34+
runs-on: ubuntu-22.04-arm
35+
permissions:
36+
contents: read
37+
packages: write
38+
steps:
39+
- name: 检查代码
40+
uses: actions/checkout@v2
2641

2742
- name: 登录 GitHub Container Registry
2843
uses: docker/login-action@v2
@@ -31,10 +46,30 @@ jobs:
3146
username: ${{ github.actor }}
3247
password: ${{ secrets.GHCR_TOKEN }}
3348

34-
- name: 构建并推送多架构Docker镜像
49+
- name: 构建并推送 arm64 Docker镜像
3550
uses: docker/build-push-action@v3
3651
with:
3752
context: .
38-
platforms: linux/amd64,linux/arm64
53+
platforms: linux/arm64
54+
push: true
55+
tags: ghcr.io/${{ github.repository_owner }}/vue-xiuxiangame:arm64-latest
56+
57+
create-manifest:
58+
needs: [build-amd64, build-arm64]
59+
runs-on: ubuntu-latest
60+
permissions:
61+
contents: read
62+
packages: write
63+
steps:
64+
- name: 登录 GitHub Container Registry
65+
uses: docker/login-action@v2
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GHCR_TOKEN }}
70+
71+
- name: 创建并推送多架构清单
72+
uses: docker/build-push-action@v3
73+
with:
3974
push: true
4075
tags: ghcr.io/${{ github.repository_owner }}/vue-xiuxiangame:latest

0 commit comments

Comments
 (0)