Fix document action and content (#5308)

* fix: action

* remove cache

* update action

* doc (#102)

* doc (#101)

* do

* add redirect

* doc

* fix: action

* action

* doc

* fix: action

* fix: action

* action
This commit is contained in:
Archer
2025-07-24 14:23:04 +08:00
committed by GitHub
parent 68136febec
commit c390eb186c
8 changed files with 38 additions and 51 deletions

View File

@@ -51,20 +51,6 @@ jobs:
${{ matrix.domain_config.suffix }}-${{ needs.generate-timestamp.outputs.datetime }}
flavor: latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ matrix.domain_config.suffix }}
key: ${{ runner.os }}-docs-buildx-${{ matrix.domain_config.suffix }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docs-buildx-${{ matrix.domain_config.suffix }}-
- name: Login to Aliyun
uses: docker/login-action@v3
with:
@@ -72,7 +58,8 @@ jobs:
username: ${{ secrets.ALI_HUB_USERNAME }}
password: ${{ secrets.ALI_HUB_PASSWORD }}
- name: Build and push Docker images
- name: Build and push Docker images (CN)
if: matrix.domain_config.suffix == 'cn'
uses: docker/build-push-action@v5
with:
context: ./document
@@ -80,14 +67,27 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# 使用本地缓存替代 GHA 缓存
cache-from: type=local,src=/tmp/.buildx-cache-${{ matrix.domain_config.suffix }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ matrix.domain_config.suffix }}
platforms: linux/amd64
build-args: |
NEXT_PUBLIC_SEARCH_APPKEY=c4708d48f2de6ac5d2f0f443979ef92a
NEXT_PUBLIC_SEARCH_APPID=HZAF4C2T88
FASTGPT_HOME_DOMAIN=${{ matrix.domain_config.domain }}
SEARCH_APPWRITEKEY=${{ secrets.SEARCH_APPWRITEKEY }}
- name: Build and push Docker images (IO)
if: matrix.domain_config.suffix == 'io'
uses: docker/build-push-action@v5
with:
context: ./document
file: ./document/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
build-args: |
NEXT_PUBLIC_SEARCH_APPKEY=c4708d48f2de6ac5d2f0f443979ef92a
NEXT_PUBLIC_SEARCH_APPID=HZAF4C2T88
FASTGPT_HOME_DOMAIN=${{ matrix.domain_config.domain }}
${{ matrix.domain_config.suffix == 'cn' && 'SEARCH_APPWRITEKEY=${{ secrets.SEARCH_APPWRITEKEY }}' || '' }}
update-images:
needs: [generate-timestamp, build-images]

View File

@@ -35,20 +35,6 @@ jobs:
${{ steps.datetime.outputs.datetime }}
flavor: latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docs-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docs-buildx-
- name: Login to Aliyun
uses: docker/login-action@v3
with:
@@ -64,9 +50,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# 使用本地缓存替代 GHA 缓存
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
NEXT_PUBLIC_SEARCH_APPKEY=c4708d48f2de6ac5d2f0f443979ef92a
NEXT_PUBLIC_SEARCH_APPID=HZAF4C2T88

View File

@@ -30,7 +30,8 @@ ENV SEARCH_APPWRITEKEY=$SEARCH_APPWRITEKEY
ENV FASTGPT_HOME_DOMAIN=$FASTGPT_HOME_DOMAIN
COPY . .
RUN npm install && npm run build
RUN npm install
RUN npm run build
# Update search index if SEARCH_APPWRITEKEY is provided
RUN if [ -n "$SEARCH_APPWRITEKEY" ]; then \
echo "SEARCH_APPWRITEKEY found, updating search index..." && \
@@ -39,15 +40,6 @@ RUN if [ -n "$SEARCH_APPWRITEKEY" ]; then \
echo "SEARCH_APPWRITEKEY not provided, skipping search index update"; \
fi
# Run update-index-action if SEARCH_APPWRITEKEY is provided
RUN if [ -n "$SEARCH_APPWRITEKEY" ]; then \
echo "SEARCH_APPWRITEKEY is provided, running update-index-action..."; \
npm run update-index-action; \
else \
echo "SEARCH_APPWRITEKEY is not provided, skipping update-index-action"; \
fi
FROM base AS runner
RUN apk add --no-cache curl
ENV NODE_ENV=production

View File

@@ -15,6 +15,10 @@ import {
} from 'fumadocs-ui/components/dialog/search';
import { useI18n } from 'fumadocs-ui/contexts/i18n';
console.log({
NEXT_PUBLIC_SEARCH_APPID: process.env.NEXT_PUBLIC_SEARCH_APPID,
NEXT_PUBLIC_SEARCH_APPKEY: process.env.NEXT_PUBLIC_SEARCH_APPKEY
})
if (!process.env.NEXT_PUBLIC_SEARCH_APPID || !process.env.NEXT_PUBLIC_SEARCH_APPKEY) {
throw new Error('NEXT_PUBLIC_SEARCH_APPID and NEXT_PUBLIC_SEARCH_APPKEY are not set');
}

View File

@@ -3,7 +3,6 @@ title: 使用案例
description: FastGPT 使用案例
---
import { Redirect } from '@/components/docs/Redirect';
<Redirect to="/docs/use-cases/external-integration/openapi" />

View File

@@ -1,10 +1,13 @@
import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from 'fumadocs-mdx/config';
import { z } from 'zod';
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
export const docs = defineDocs({
docs: {
schema: frontmatterSchema
schema: frontmatterSchema.extend({
title: z.string().optional().default('Untitled')
})
},
meta: {
schema: metaSchema

View File

@@ -9,7 +9,13 @@ async function main() {
/** @type {import('fumadocs-core/search/algolia').DocumentRecord[]} **/
const records = JSON.parse(content.toString());
if (!process.env.NEXT_PUBLIC_SEARCH_APPID || !process.env.SEARCH_APPWRITEKEY) {
console.log({
NEXT_PUBLIC_SEARCH_APPID: process.env.NEXT_PUBLIC_SEARCH_APPID,
SEARCH_APPWRITEKEY: process.env.SEARCH_APPWRITEKEY,
SEARCH_APPWRITEKEY: process.env.SEARCH_APPWRITEKEY
})
if (!process.env.NEXT_PUBLIC_SEARCH_APPID || !process.env.SEARCH_APPWRITEKEY || !process.env.SEARCH_APPWRITEKEY) {
console.log('NEXT_PUBLIC_SEARCH_APPID or SEARCH_APPWRITEKEY is not set');
return;
}