Skip to content

Commit 5cf530c

Browse files
whitewatercn88250
authored andcommitted
增加多个平台docker的构建
1 parent 33433c7 commit 5cf530c

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.github/workflows/dockerimage.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,26 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@master
11-
- name: Build the Docker image
12-
run: |
13-
docker login --username=${{ secrets.DOCKER_HUB_USER }} --password=${{ secrets.DOCKER_HUB_PWD }}
14-
docker build --build-arg git_commit=$(git rev-parse --short HEAD) -t b3log/solo:latest .
15-
docker push b3log/solo
10+
- uses: actions/checkout@master
11+
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v3
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Login to DockerHub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKER_HUB_USER }}
22+
password: ${{ secrets.DOCKER_HUB_PWD }}
23+
24+
- name: Build and push multi-platform Docker image
25+
run: |
26+
docker buildx build \
27+
--platform linux/amd64,linux/arm64/v8,linux/arm/v7,windows/amd64 \
28+
--build-arg git_commit=$(git rev-parse --short HEAD) \
29+
-t b3log/solo:latest \
30+
--push .
31+
32+

0 commit comments

Comments
 (0)