mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-10 01:08:08 +08:00
chore: update turbo.json
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
name: Build fastgpt-pro images
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
image_tag:
|
||||
description: 'Optional image tag. Defaults to manual-<short-sha>.'
|
||||
required: false
|
||||
type: string
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-fastgpt-pro-images:
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
strategy:
|
||||
matrix:
|
||||
archs:
|
||||
- arch: amd64
|
||||
- arch: arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.archs.runs-on || 'ubuntu-24.04' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Update submodules
|
||||
env:
|
||||
PRO_SUBMODULE_TOKEN: ${{ secrets.PRO_SUBMODULE_TOKEN }}
|
||||
run: |
|
||||
if [ -z "${PRO_SUBMODULE_TOKEN}" ]; then
|
||||
echo "::error::PRO_SUBMODULE_TOKEN is required to clone the private pro submodule."
|
||||
exit 1
|
||||
fi
|
||||
git config --global url."https://x-access-token:${PRO_SUBMODULE_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
git submodule update --init --recursive --jobs 8
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
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 }}-${{ matrix.archs.arch }}-fastgpt-pro-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.archs.arch }}-fastgpt-pro-buildx-
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build for ${{ matrix.archs.arch }}
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: pro/admin/Dockerfile
|
||||
platforms: linux/${{ matrix.archs.arch }}
|
||||
labels: |
|
||||
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
||||
org.opencontainers.image.description=fastgpt-pro image
|
||||
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/fastgpt-pro",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/fastgpt-pro
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "${{ runner.temp }}/digests/fastgpt-pro/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-fastgpt-pro-${{ github.sha }}-${{ matrix.archs.arch }}
|
||||
path: ${{ runner.temp }}/digests/fastgpt-pro/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
release-fastgpt-pro-images:
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
needs: build-fastgpt-pro-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.FASTGPT_ALI_IMAGE_USER }}
|
||||
password: ${{ secrets.FASTGPT_ALI_IMAGE_PSW }}
|
||||
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/digests
|
||||
pattern: digests-fastgpt-pro-${{ 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.event_name }}" == "workflow_dispatch" ]]; then
|
||||
INPUT_TAG="${{ inputs.image_tag }}"
|
||||
IMAGE_TAG="${INPUT_TAG:-manual-${GITHUB_SHA::7}}"
|
||||
echo "Git_Tags=ghcr.io/${{ github.repository_owner }}/fastgpt-pro:${IMAGE_TAG}" >> "$GITHUB_ENV"
|
||||
echo "Ali_Tags=${{ secrets.FASTGPT_ALI_IMAGE_PREFIX }}/fastgpt-pro:${IMAGE_TAG}" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "Git_Tags=ghcr.io/${{ github.repository_owner }}/fastgpt-pro:${{ github.ref_name }} ghcr.io/${{ github.repository_owner }}/fastgpt-pro:latest" >> "$GITHUB_ENV"
|
||||
echo "Ali_Tags=${{ secrets.FASTGPT_ALI_IMAGE_PREFIX }}/fastgpt-pro:${{ github.ref_name }} ${{ secrets.FASTGPT_ALI_IMAGE_PREFIX }}/fastgpt-pro:latest" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/digests
|
||||
run: |
|
||||
TAGS="$(echo -e "${Git_Tags}\n${Ali_Tags}")"
|
||||
for TAG in $TAGS; do
|
||||
docker buildx imagetools create -t $TAG \
|
||||
$(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-pro@sha256:%s ' *)
|
||||
sleep 5
|
||||
done
|
||||
@@ -3,6 +3,10 @@
|
||||
"ui": "tui",
|
||||
"tasks": {
|
||||
"dev": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"dev:pro": {
|
||||
"with": ["@fastgpt/admin#dev"],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
|
||||
Reference in New Issue
Block a user