From ea74c669eecf2153c585bffc6ac9dfb5fa0db3b7 Mon Sep 17 00:00:00 2001 From: zijiren <84728412+zijiren233@users.noreply.github.com> Date: Mon, 14 Apr 2025 17:32:38 +0800 Subject: [PATCH] feat: github workflow arm runner (#4530) * feat: arm runner * fix * fix: outputs name * fix: outputs name * fix: 429 * feat: cache key * fix: tags * fix: tags * feat: sandbox arm64 runner * fix: sandbox dockerfile * feat: merge build --- .github/workflows/fastgpt-build-image.yml | 292 +++++++--------------- .github/workflows/sandbox-build-image.yml | 122 ++++++--- 2 files changed, 181 insertions(+), 233 deletions(-) diff --git a/.github/workflows/fastgpt-build-image.yml b/.github/workflows/fastgpt-build-image.yml index 26ef9fcf0..703f22a21 100644 --- a/.github/workflows/fastgpt-build-image.yml +++ b/.github/workflows/fastgpt-build-image.yml @@ -1,12 +1,14 @@ name: Build FastGPT images + on: workflow_dispatch: push: paths: - - 'projects/app/**' - - 'packages/**' + - "projects/app/**" + - "packages/**" tags: - - 'v*' + - "v*" + jobs: build-fastgpt-images: permissions: @@ -14,260 +16,156 @@ jobs: contents: read attestations: write id-token: write - runs-on: ubuntu-20.04 + strategy: + matrix: + sub_routes: + - repo: fastgpt + base_url: "" + - repo: fastgpt-sub-route + base_url: "/fastai" + - repo: fastgpt-sub-route-gchat + base_url: "/gchat" + archs: + - arch: amd64 + - arch: arm64 + runs-on: ubuntu-24.04-arm + runs-on: ${{ matrix.archs.runs-on || 'ubuntu-24.04' }} steps: # install env - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 - - name: Install Dependencies - run: | - sudo apt update && sudo apt install -y nodejs npm - - name: Set up QEMU (optional) - uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: driver-opts: network=host + - name: Cache Docker layers uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-${{ matrix.sub_routes.repo }}-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx- + ${{ runner.os }}-${{ matrix.sub_routes.repo }}-buildx- # login docker - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Ali Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: registry.cn-hangzhou.aliyuncs.com username: ${{ secrets.ALI_HUB_USERNAME }} password: ${{ secrets.ALI_HUB_PASSWORD }} - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_NAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - # Set tag - - name: Set image name and tag - run: | - if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - else - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV - fi + - name: Build for ${{ matrix.archs.arch }} + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: projects/app/Dockerfile + platforms: linux/${{ matrix.archs.arch }} + build-args: | + ${{ matrix.sub_routes.base_url && format('base_url={0}', matrix.sub_routes.base_url) || '' }} + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }} + org.opencontainers.image.description=${{ matrix.sub_routes.repo }} image + outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }},${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }},${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}",push-by-digest=true,push=true + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - - name: Build and publish image for main branch or tag push event - env: - DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} + - name: Export digest run: | - docker buildx build \ - -f projects/app/Dockerfile \ - --platform linux/amd64,linux/arm64 \ - --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \ - --label "org.opencontainers.image.description=fastgpt image" \ - --push \ - --cache-from=type=local,src=/tmp/.buildx-cache \ - --cache-to=type=local,dest=/tmp/.buildx-cache \ - -t ${Git_Tag} \ - -t ${Git_Latest} \ - -t ${Ali_Tag} \ - -t ${Ali_Latest} \ - -t ${Docker_Hub_Tag} \ - -t ${Docker_Hub_Latest} \ - . - build-fastgpt-images-sub-route: + mkdir -p ${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }} + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }}/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ matrix.sub_routes.repo }}-${{ github.sha }}-${{ matrix.archs.arch }} + path: ${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }}/* + if-no-files-found: error + retention-days: 1 + + release-fastgpt-images: permissions: packages: write contents: read attestations: write id-token: write - runs-on: ubuntu-20.04 + needs: build-fastgpt-images + strategy: + matrix: + sub_routes: + - repo: fastgpt + - repo: fastgpt-sub-route + - repo: fastgpt-sub-route-gchat + runs-on: ubuntu-24.04 steps: - # install env - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - name: Install Dependencies - run: | - sudo apt update && sudo apt install -y nodejs npm - - name: Set up QEMU (optional) - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver-opts: network=host - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - # login docker - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Ali Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: registry.cn-hangzhou.aliyuncs.com username: ${{ secrets.ALI_HUB_USERNAME }} password: ${{ secrets.ALI_HUB_PASSWORD }} - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_NAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - # Set tag - - name: Set image name and tag - run: | - if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - else - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV - fi - - - name: Build and publish image for main branch or tag push event - env: - DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} - run: | - docker buildx build \ - -f projects/app/Dockerfile \ - --platform linux/amd64,linux/arm64 \ - --build-arg base_url=/fastai \ - --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \ - --label "org.opencontainers.image.description=fastgpt image" \ - --push \ - --cache-from=type=local,src=/tmp/.buildx-cache \ - --cache-to=type=local,dest=/tmp/.buildx-cache \ - -t ${Git_Tag} \ - -t ${Git_Latest} \ - -t ${Ali_Tag} \ - -t ${Ali_Latest} \ - -t ${Docker_Hub_Tag} \ - -t ${Docker_Hub_Latest} \ - . - build-fastgpt-images-sub-route-gchat: - permissions: - packages: write - contents: read - attestations: write - id-token: write - runs-on: ubuntu-20.04 - steps: - # install env - - name: Checkout - uses: actions/checkout@v3 + - name: Download digests + uses: actions/download-artifact@v4 with: - fetch-depth: 1 - - name: Install Dependencies - run: | - sudo apt update && sudo apt install -y nodejs npm - - name: Set up QEMU (optional) - uses: docker/setup-qemu-action@v2 + path: ${{ runner.temp }}/digests + pattern: digests-${{ matrix.sub_routes.repo }}-${{ github.sha }}-* + merge-multiple: true + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver-opts: network=host - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + uses: docker/setup-buildx-action@v3 - # login docker - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Ali Hub - uses: docker/login-action@v2 - with: - registry: registry.cn-hangzhou.aliyuncs.com - username: ${{ secrets.ALI_HUB_USERNAME }} - password: ${{ secrets.ALI_HUB_PASSWORD }} - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_HUB_NAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - # Set tag - name: Set image name and tag run: | if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV + echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV else - echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV - echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV - echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV + echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV + echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV fi - - name: Build and publish image for main branch or tag push event - env: - DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests run: | - docker buildx build \ - -f projects/app/Dockerfile \ - --platform linux/amd64,linux/arm64 \ - --build-arg base_url=/gchat \ - --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \ - --label "org.opencontainers.image.description=fastgpt-sub-route-gchat image" \ - --push \ - --cache-from=type=local,src=/tmp/.buildx-cache \ - --cache-to=type=local,dest=/tmp/.buildx-cache \ - -t ${Git_Tag} \ - -t ${Git_Latest} \ - -t ${Ali_Tag} \ - -t ${Ali_Latest} \ - -t ${Docker_Hub_Tag} \ - -t ${Docker_Hub_Latest} \ - . + TAGS="$(echo -e "${Git_Tag}\n${Git_Latest}\n${Ali_Tag}\n${Ali_Latest}\n${Docker_Hub_Tag}\n${Docker_Hub_Latest}")" + for TAG in $TAGS; do + docker buildx imagetools create -t $TAG \ + $(printf 'ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}@sha256:%s ' *) + sleep 5 + done diff --git a/.github/workflows/sandbox-build-image.yml b/.github/workflows/sandbox-build-image.yml index 873582cf3..d21e1f84b 100644 --- a/.github/workflows/sandbox-build-image.yml +++ b/.github/workflows/sandbox-build-image.yml @@ -13,50 +13,115 @@ jobs: contents: read attestations: write id-token: write - runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - arch: amd64 + - arch: arm64 + runs-on: ubuntu-24.04-arm + runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }} steps: # install env - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install Dependencies - run: | - sudo apt update && sudo apt install -y nodejs npm - - name: Set up QEMU (optional) - uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: driver-opts: network=host - name: Cache Docker layers uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-sandbox-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx- + ${{ runner.os }}-sandbox-buildx- # login docker - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Ali Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: registry.cn-hangzhou.aliyuncs.com username: ${{ secrets.ALI_HUB_USERNAME }} password: ${{ secrets.ALI_HUB_PASSWORD }} - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_NAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - # Set tag + - name: Build for ${{ matrix.arch }} + id: build + uses: docker/build-push-action@v6 + with: + context: . + file: projects/sandbox/Dockerfile + platforms: linux/${{ matrix.arch }} + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/fastgpt-sandbox + org.opencontainers.image.description=fastgpt-sandbox image + outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox,${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox,${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox",push-by-digest=true,push=true + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-fastgpt-sandbox-${{ github.sha }}-${{ matrix.arch }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + release-fastgpt-sandbox-images: + permissions: + packages: write + contents: read + attestations: write + id-token: write + needs: build-fastgpt-sandbox-images + runs-on: ubuntu-24.04 + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Ali Hub + uses: docker/login-action@v3 + with: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALI_HUB_USERNAME }} + password: ${{ secrets.ALI_HUB_PASSWORD }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_NAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-fastgpt-sandbox-${{ github.sha }}-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set image name and tag run: | if [[ "${{ github.ref_name }}" == "main" ]]; then @@ -75,27 +140,12 @@ jobs: echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV fi - - name: Build and publish image for main branch or tag push event - env: - Git_Tag: ${{ env.Git_Tag }} - Git_Latest: ${{ env.Git_Latest }} - Ali_Tag: ${{ env.Ali_Tag }} - Ali_Latest: ${{ env.Ali_Latest }} - Docker_Hub_Tag: ${{ env.Docker_Hub_Tag }} - Docker_Hub_Latest: ${{ env.Docker_Hub_Latest }} + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests run: | - docker buildx build \ - -f projects/sandbox/Dockerfile \ - --platform linux/amd64,linux/arm64 \ - --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/fastgpt-sandbox" \ - --label "org.opencontainers.image.description=fastgpt-sandbox image" \ - --push \ - --cache-from=type=local,src=/tmp/.buildx-cache \ - --cache-to=type=local,dest=/tmp/.buildx-cache \ - -t ${Git_Tag} \ - -t ${Git_Latest} \ - -t ${Ali_Tag} \ - -t ${Ali_Latest} \ - -t ${Docker_Hub_Tag} \ - -t ${Docker_Hub_Latest} \ - . + TAGS="$(echo -e "${Git_Tag}\n${Git_Latest}\n${Ali_Tag}\n${Ali_Latest}\n${Docker_Hub_Tag}\n${Docker_Hub_Latest}")" + for TAG in $TAGS; do + docker buildx imagetools create -t $TAG \ + $(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox@sha256:%s ' *) + sleep 5 + done