Commit be6274d4 by DigHuang Committed by GitHub

refactor(fastgpt): update default fastgpt-ide-agent image to ghcr.io (#7124)

parent 0b86c361
name: Build fastgpt-ide-agent images name: Build fastgpt agent helper images
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
ide_agent_tag:
description: 'fastgpt-ide-agent image tag'
required: false
default: latest
type: string
agent_sandbox_proxy_tag:
description: 'fastgpt-agent-sandbox-proxy image tag'
required: false
default: latest
type: string
jobs: jobs:
build-fastgpt-ide-agent-images: build-fastgpt-agent-helper-images:
permissions: permissions:
packages: write packages: write
contents: read contents: read
strategy: strategy:
matrix: matrix:
include: include:
- arch: amd64 - image: fastgpt-ide-agent
- arch: arm64 context: projects/fastgpt-ide-agent
dockerfile: projects/fastgpt-ide-agent/Dockerfile
description: fastgpt-ide-agent image
arch: amd64
- image: fastgpt-ide-agent
context: projects/fastgpt-ide-agent
dockerfile: projects/fastgpt-ide-agent/Dockerfile
description: fastgpt-ide-agent image
arch: arm64
runs-on: ubuntu-24.04-arm
- image: fastgpt-agent-sandbox-proxy
context: projects/agent-sandbox-proxy
dockerfile: projects/agent-sandbox-proxy/Dockerfile
description: fastgpt-agent-sandbox-proxy image
arch: amd64
- image: fastgpt-agent-sandbox-proxy
context: projects/agent-sandbox-proxy
dockerfile: projects/agent-sandbox-proxy/Dockerfile
description: fastgpt-agent-sandbox-proxy image
arch: arm64
runs-on: ubuntu-24.04-arm runs-on: ubuntu-24.04-arm
runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }} runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }}
steps: steps:
...@@ -29,11 +59,11 @@ jobs: ...@@ -29,11 +59,11 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: ${{ runner.os }}-ide-agent-buildx-${{ github.sha }} key: ${{ runner.os }}-${{ matrix.image }}-buildx-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-ide-agent-buildx- ${{ runner.os }}-${{ matrix.image }}-buildx-
# Push per-arch images by digest first; the release job publishes the latest manifest. # Push per-arch images by digest first; the release job publishes the final manifest tag.
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
...@@ -45,13 +75,13 @@ jobs: ...@@ -45,13 +75,13 @@ jobs:
id: build id: build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: projects/fastgpt-ide-agent context: ${{ matrix.context }}
file: projects/fastgpt-ide-agent/Dockerfile file: ${{ matrix.dockerfile }}
platforms: linux/${{ matrix.arch }} platforms: linux/${{ matrix.arch }}
labels: | labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }} org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=fastgpt-ide-agent image org.opencontainers.image.description=${{ matrix.description }}
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/fastgpt-ide-agent",push-by-digest=true,push=true outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}",push-by-digest=true,push=true
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache
...@@ -64,16 +94,23 @@ jobs: ...@@ -64,16 +94,23 @@ jobs:
- name: Upload digest - name: Upload digest
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: digests-fastgpt-ide-agent-${{ github.sha }}-${{ matrix.arch }} name: digests-${{ matrix.image }}-${{ github.sha }}-${{ matrix.arch }}
path: ${{ runner.temp }}/digests/* path: ${{ runner.temp }}/digests/*
if-no-files-found: error if-no-files-found: error
retention-days: 1 retention-days: 1
release-fastgpt-ide-agent-images: release-fastgpt-agent-helper-images:
permissions: permissions:
packages: write packages: write
contents: read contents: read
needs: build-fastgpt-ide-agent-images needs: build-fastgpt-agent-helper-images
strategy:
matrix:
include:
- image: fastgpt-ide-agent
tag: ${{ inputs.ide_agent_tag || 'latest' }}
- image: fastgpt-agent-sandbox-proxy
tag: ${{ inputs.agent_sandbox_proxy_tag || 'latest' }}
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
...@@ -86,7 +123,7 @@ jobs: ...@@ -86,7 +123,7 @@ jobs:
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: ${{ runner.temp }}/digests path: ${{ runner.temp }}/digests
pattern: digests-fastgpt-ide-agent-${{ github.sha }}-* pattern: digests-${{ matrix.image }}-${{ github.sha }}-*
merge-multiple: true merge-multiple: true
- name: Set up Docker Buildx - name: Set up Docker Buildx
...@@ -94,10 +131,10 @@ jobs: ...@@ -94,10 +131,10 @@ jobs:
- name: Set image name and tag - name: Set image name and tag
run: | run: |
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-ide-agent:latest" >> $GITHUB_ENV echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${{ matrix.tag }}" >> $GITHUB_ENV
- name: Create manifest list and push - name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests working-directory: ${{ runner.temp }}/digests
run: | run: |
docker buildx imagetools create -t "${Git_Latest}" \ docker buildx imagetools create -t "${Git_Tag}" \
$(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-ide-agent@sha256:%s ' *) $(printf 'ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}@sha256:%s ' *)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment