mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	Support multi-arch docker build
This commit is contained in:
		
							
								
								
									
										35
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +1,7 @@
 | 
			
		||||
name: Publish Docker image
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
  release:
 | 
			
		||||
    types: [published]
 | 
			
		||||
 | 
			
		||||
@@ -9,25 +10,43 @@ jobs:
 | 
			
		||||
    name: Push Docker image to Docker Hub
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Check out the repo
 | 
			
		||||
      -
 | 
			
		||||
        name: Check out the repo
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      
 | 
			
		||||
      - name: Log in to Docker Hub
 | 
			
		||||
        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
 | 
			
		||||
      -
 | 
			
		||||
        name: Log in to Docker Hub
 | 
			
		||||
        uses: docker/login-action@v2
 | 
			
		||||
        with:
 | 
			
		||||
          username: ${{ secrets.DOCKER_USERNAME }}
 | 
			
		||||
          password: ${{ secrets.DOCKER_PASSWORD }}
 | 
			
		||||
      
 | 
			
		||||
      - name: Extract metadata (tags, labels) for Docker
 | 
			
		||||
      - 
 | 
			
		||||
        name: Extract metadata (tags, labels) for Docker
 | 
			
		||||
        id: meta
 | 
			
		||||
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
 | 
			
		||||
        uses: docker/metadata-action@v4
 | 
			
		||||
        with:
 | 
			
		||||
          images: yidadaa/chatgpt-next-web
 | 
			
		||||
          tags: |
 | 
			
		||||
            type=raw,value=latest
 | 
			
		||||
            type=semver,pattern={{version}}
 | 
			
		||||
      
 | 
			
		||||
      - name: Build and push Docker image
 | 
			
		||||
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
 | 
			
		||||
      - 
 | 
			
		||||
        name: Set up QEMU
 | 
			
		||||
        uses: docker/setup-qemu-action@v2
 | 
			
		||||
 | 
			
		||||
      - 
 | 
			
		||||
        name: Set up Docker Buildx
 | 
			
		||||
        uses: docker/setup-buildx-action@v2
 | 
			
		||||
      
 | 
			
		||||
      - 
 | 
			
		||||
        name: Build and push Docker image
 | 
			
		||||
        uses: docker/build-push-action@v4
 | 
			
		||||
        with:
 | 
			
		||||
          context: .
 | 
			
		||||
          platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
 | 
			
		||||
          push: true
 | 
			
		||||
          tags: ${{ steps.meta.outputs.tags }}
 | 
			
		||||
          labels: ${{ steps.meta.outputs.labels }}
 | 
			
		||||
          cache-from: type=gha
 | 
			
		||||
          cache-to: type=gha,mode=max
 | 
			
		||||
            
 | 
			
		||||
@@ -9,7 +9,7 @@ WORKDIR /app
 | 
			
		||||
COPY package.json yarn.lock* package-lock.json* ./
 | 
			
		||||
 | 
			
		||||
RUN \
 | 
			
		||||
  if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
 | 
			
		||||
  if [ -f yarn.lock ]; then yarn install --frozen-lockfile --network-timeout 100000; \
 | 
			
		||||
  elif [ -f package-lock.json ]; then npm ci; \
 | 
			
		||||
  else echo "Lockfile not found." && exit 1; \
 | 
			
		||||
  fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user