Skip to content

Commit dab69c7

Browse files
authored
Merge pull request #215 from hibobmaster/multi-arch-docker-build
CI: Multi Arch docker builds
2 parents fe85862 + 852f8b8 commit dab69c7

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/docker.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Publish Docker image
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [published]
67

@@ -9,25 +10,43 @@ jobs:
910
name: Push Docker image to Docker Hub
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Check out the repo
13+
-
14+
name: Check out the repo
1315
uses: actions/checkout@v3
14-
15-
- name: Log in to Docker Hub
16-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
16+
-
17+
name: Log in to Docker Hub
18+
uses: docker/login-action@v2
1719
with:
1820
username: ${{ secrets.DOCKER_USERNAME }}
1921
password: ${{ secrets.DOCKER_PASSWORD }}
2022

21-
- name: Extract metadata (tags, labels) for Docker
23+
-
24+
name: Extract metadata (tags, labels) for Docker
2225
id: meta
23-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
26+
uses: docker/metadata-action@v4
2427
with:
2528
images: yidadaa/chatgpt-next-web
29+
tags: |
30+
type=raw,value=latest
31+
type=semver,pattern={{version}}
32+
33+
-
34+
name: Set up QEMU
35+
uses: docker/setup-qemu-action@v2
36+
37+
-
38+
name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v2
2640

27-
- name: Build and push Docker image
28-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
41+
-
42+
name: Build and push Docker image
43+
uses: docker/build-push-action@v4
2944
with:
3045
context: .
46+
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
3147
push: true
3248
tags: ${{ steps.meta.outputs.tags }}
3349
labels: ${{ steps.meta.outputs.labels }}
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max
52+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WORKDIR /app
99
COPY package.json yarn.lock* package-lock.json* ./
1010

1111
RUN \
12-
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
12+
if [ -f yarn.lock ]; then yarn install --frozen-lockfile --network-timeout 100000; \
1313
elif [ -f package-lock.json ]; then npm ci; \
1414
else echo "Lockfile not found." && exit 1; \
1515
fi

0 commit comments

Comments
 (0)