From 393b7abe7db9731fb69334a69ccfa64392e420fd Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Wed, 23 Jul 2025 23:27:37 +0800 Subject: [PATCH] Document action (#5304) * fix: context * fix: context * action * update scripts * update action * fix: kubeconfig * update preview * docker file * perf: action per * update doc deploy yml * doc (#99) * doc * doc * rename * doc * fix: action on * doc (#100) --- .github/doc-sync-image.yml | 4 - .github/workflows/docs-deploy-cf.yml | 71 ----------- .github/workflows/docs-deploy-kubeconfig.yml | 90 -------------- .github/workflows/docs-deploy.yml | 117 ++++++++++++++++++ .github/workflows/docs-preview.yml | 73 +++++++---- .github/workflows/docs-sync_imgs.yml | 23 ---- document/.dockerignore | 78 +++++++++--- document/.env.template | 2 +- document/Dockerfile | 4 +- document/README.md | 2 +- document/app/global.css | 16 ++- document/components/docs/linkFastGPT.tsx | 2 +- .../development/upgrading/4110.mdx | 2 +- .../development/upgrading/4111.mdx | 8 +- document/next.config.mjs | 1 + document/package.json | 4 +- 16 files changed, 250 insertions(+), 247 deletions(-) delete mode 100644 .github/doc-sync-image.yml delete mode 100644 .github/workflows/docs-deploy-cf.yml delete mode 100644 .github/workflows/docs-deploy-kubeconfig.yml create mode 100644 .github/workflows/docs-deploy.yml delete mode 100644 .github/workflows/docs-sync_imgs.yml diff --git a/.github/doc-sync-image.yml b/.github/doc-sync-image.yml deleted file mode 100644 index 800e23cd9..000000000 --- a/.github/doc-sync-image.yml +++ /dev/null @@ -1,4 +0,0 @@ -yangchuansheng/fastgpt-imgs: - - source: docSite/assets/imgs/ - dest: imgs/ - deleteOrphaned: true diff --git a/.github/workflows/docs-deploy-cf.yml b/.github/workflows/docs-deploy-cf.yml deleted file mode 100644 index dd0510fb2..000000000 --- a/.github/workflows/docs-deploy-cf.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Deploy doc image to cf - -on: - workflow_dispatch: - push: - paths: - - 'docSite/**' - branches: - - 'main' - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains jobs "deploy-production" - deploy-production: - # The environment this job references - environment: - name: Production - url: ${{ steps.vercel-action.outputs.preview-url }} - - # The type of runner that the job will run on - runs-on: ubuntu-24.04 - - permissions: - contents: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - - # Job outputs - outputs: - docs: ${{ steps.filter.outputs.docs }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Step 1 - Checks-out your repository under $GITHUB_WORKSPACE - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive # Fetch submodules - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - # Step 2 Detect changes to Docs Content - - name: Detect changes in doc content - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - docs: - - 'docSite/content/docs/**' - base: main - - - name: Add cdn for images - run: | - sed -i "s#\](/imgs/#\](https://cdn.jsdelivr.net/gh/yangchuansheng/fastgpt-imgs@main/imgs/#g" $(grep -rl "\](/imgs/" docSite/content/zh-cn/docs) - - # Step 3 - Install Hugo (specific version) - - name: Install Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: '0.117.0' - extended: true - - # Step 4 - Builds the site using Hugo - - name: Build - run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - if: github.ref == 'refs/heads/main' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docSite/public diff --git a/.github/workflows/docs-deploy-kubeconfig.yml b/.github/workflows/docs-deploy-kubeconfig.yml deleted file mode 100644 index 9caa9fc12..000000000 --- a/.github/workflows/docs-deploy-kubeconfig.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Deploy doc image by kubeconfig -on: - workflow_dispatch: - push: - paths: - - 'docSite/**' - branches: - - 'main' - -jobs: - build-fastgpt-docs-images: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - attestations: write - id-token: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Change baseURL - run: sed -i 's|^baseURL =.*|baseURL = "https://doc.fastgpt.cn"|g' ./docSite/hugo.toml - - - name: Get current date and time - id: datetime - run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # list of Docker images to use as base name for tags - images: | - ghcr.io/${{ github.repository_owner }}/fastgpt-docs - registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALI_HUB_USERNAME }}/fastgpt-docs - tags: | - ${{ 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: Login to ghcr.io - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Aliyun - uses: docker/login-action@v3 - with: - registry: registry.cn-hangzhou.aliyuncs.com - username: ${{ secrets.ALI_HUB_USERNAME }} - password: ${{ secrets.ALI_HUB_PASSWORD }} - - - name: Build and push Docker images to ghcr.io and DockerHub - uses: docker/build-push-action@v5 - with: - context: . - file: ./docSite/Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - outputs: - tags: ${{ steps.datetime.outputs.datetime }} - - update-docs-image: - needs: build-fastgpt-docs-images - runs-on: ubuntu-24.04 - if: github.repository == 'labring/FastGPT' - steps: - - name: Checkout code - uses: actions/checkout@v3 - - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} - with: - args: set image deployment/fastgpt-docs fastgpt-docs=registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALI_HUB_USERNAME }}/fastgpt-docs:${{ needs.build-fastgpt-docs-images.outputs.tags }} - - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} - with: - args: annotate deployment/fastgpt-docs originImageName="registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALI_HUB_USERNAME }}/fastgpt-docs:${{ needs.build-fastgpt-docs-images.outputs.tags }}" --overwrite diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 000000000..700e732c2 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,117 @@ +name: Document deploy +on: + push: + branches: + - main + paths: + - 'document/**' + workflow_dispatch: + +permissions: + contents: read + packages: write + attestations: write + id-token: write + pull-requests: write + +jobs: + build-images: + runs-on: ubuntu-latest + strategy: + matrix: + domain_config: + - domain: 'https://fastgpt.io' + suffix: 'io' + - domain: 'https://fastgpt.cn' + suffix: 'cn' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get current datetime + id: datetime + run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + ${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs + tags: | + ${{ matrix.domain_config.suffix }}-${{ 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-${{ 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: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALI_HUB_USERNAME }} + password: ${{ secrets.ALI_HUB_PASSWORD }} + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: ./document + file: ./document/Dockerfile + 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 }} + build-args: | + NEXT_PUBLIC_SEARCH_APPKEY=c4708d48f2de6ac5d2f0f443979ef92a + NEXT_PUBLIC_SEARCH_APPID=HZAF4C2T88 + NEXT_PUBLIC_HOME_DOMAIN=${{ matrix.domain_config.domain }} + outputs: + tags: ${{ steps.datetime.outputs.datetime }} + + update-images: + needs: build-images + runs-on: ubuntu-24.04 + strategy: + matrix: + domain_config: + - domain: 'https://fastgpt.io' + suffix: 'io' + deployment: 'fastgpt-docs' + kube_config: 'KUBE_CONFIG_IO' + - domain: 'https://fastgpt.cn' + suffix: 'cn' + deployment: 'fastgpt-docs' + kube_config: 'KUBE_CONFIG_CN' + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # Add kubeconfig setup step to handle encoding issues + - name: Setup kubeconfig + run: | + mkdir -p $HOME/.kube + echo "${{ secrets[matrix.domain_config.kube_config] }}" > $HOME/.kube/config + chmod 600 $HOME/.kube/config + + - name: Update deployment image + run: | + kubectl set image deployment/${{ matrix.domain_config.deployment }} ${{ matrix.domain_config.deployment }}=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ matrix.domain_config.suffix }}-${{ needs.build-images.outputs.tags }} + + - name: Annotate deployment + run: | + kubectl annotate deployment/${{ matrix.domain_config.deployment }} originImageName="${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ matrix.domain_config.suffix }}-${{ needs.build-images.outputs.tags }}" --overwrite diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 4bc69918c..ff88ce5e5 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -5,20 +5,25 @@ on: - 'document/**' workflow_dispatch: -jobs: - build-fastgpt-docs-images: - runs-on: ubuntu-latest +permissions: + contents: read + packages: write + attestations: write + id-token: write + pull-requests: write - permissions: - contents: read - packages: write - attestations: write - id-token: write +jobs: + build-images: + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Get current datetime + id: datetime + run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -36,6 +41,14 @@ jobs: - 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: @@ -46,35 +59,42 @@ jobs: - name: Build and push Docker images uses: docker/build-push-action@v5 with: - context: . + context: ./document file: ./document/Dockerfile 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 - NEXT_PUBLIC_DOMAIN=https://vzldqobwbwna.sealoshzh.site + NEXT_PUBLIC_HOME_DOMAIN=https://fastgpt.io outputs: tags: ${{ steps.datetime.outputs.datetime }} - update-docs-image: - needs: build-fastgpt-docs-images + update-images: + needs: build-images runs-on: ubuntu-24.04 - if: github.repository == 'labring/FastGPT' steps: - name: Checkout code uses: actions/checkout@v4 - - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} - with: - args: set image deployment/fastgpt-docs-preview fastgpt-docs-preview=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ needs.build-fastgpt-docs-images.outputs.tags }} - - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} - with: - args: annotate deployment/fastgpt-docs-preview originImageName="${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ needs.build-fastgpt-docs-images.outputs.tags }}" --overwrite + + # Add kubeconfig setup step to handle encoding issues + - name: Setup kubeconfig + run: | + mkdir -p $HOME/.kube + echo "${{ secrets.KUBE_CONFIG_CN }}" > $HOME/.kube/config + chmod 600 $HOME/.kube/config + + - name: Update deployment image + run: | + kubectl set image deployment/fastgpt-docs-preview fastgpt-docs-preview=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ needs.build-images.outputs.tags }} + + - name: Annotate deployment + run: | + kubectl annotate deployment/fastgpt-docs-preview originImageName="${{ secrets.ALI_IMAGE_NAME }}/fastgpt-docs:${{ needs.build-images.outputs.tags }}" --overwrite - name: '@finleyge/github-tools' uses: FinleyGe/github-tools@0.0.1 @@ -85,6 +105,7 @@ jobs: tool: issue-comment title: 'Docs Preview:' body: | - ``` - 🔗 Preview URL: https://vzldqobwbwna.sealoshzh.site - ``` + --- + 🚀 **FastGPT Document Preview Ready!** + + 🔗 [👀 Click here to visit preview](https://pueuoharpgcl.sealoshzh.site) diff --git a/.github/workflows/docs-sync_imgs.yml b/.github/workflows/docs-sync_imgs.yml deleted file mode 100644 index be0f05b63..000000000 --- a/.github/workflows/docs-sync_imgs.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Sync images -on: - push: - branches: - - main - paths: - - docSite/assets/imgs/** - workflow_dispatch: -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Run GitHub File Sync - uses: BetaHuhn/repo-file-sync-action@v1.21.0 - with: - GH_PAT: ${{ secrets.IMG_GH_PAT }} - CONFIG_PATH: .github/doc-sync-image.yml - ORIGINAL_MESSAGE: true - SKIP_PR: true - COMMIT_EACH_FILE: false diff --git a/document/.dockerignore b/document/.dockerignore index 1712dae54..65d26cc93 100644 --- a/document/.dockerignore +++ b/document/.dockerignore @@ -1,24 +1,68 @@ -# 开发环境文件 +# Dependencies +node_modules +npm-debug.log* +pnpm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Local env files +.env +.env.local +.env.production.local +.env.test.local + +# Vercel +.vercel + +# Typescript +*.tsbuildinfo + +# Next.js +.next/ +out/ + +# Production +build + +# Misc +.DS_Store +*.pem + +# Debug +debug.log* + +# Git .git .gitignore -.env* -.next -node_modules -# Docker 相关 -Dockerfile -.dockerignore +# Testing +coverage +.nyc_output -# 其他 -README.md -*.log -.DS_Store - -# 缓存文件 +# Cache .cache -.npm -.pnpm-store +.parcel-cache -# IDE 配置 +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Coverage directory used by tools like istanbul +coverage/ + +# IDE .vscode -.idea \ No newline at end of file +.idea + +# OS +Thumbs.db + +# Temporary folders +tmp/ +temp/ \ No newline at end of file diff --git a/document/.env.template b/document/.env.template index 33f5c41c4..74640cf4f 100644 --- a/document/.env.template +++ b/document/.env.template @@ -1,4 +1,4 @@ NEXT_PUBLIC_SEARCH_APPKEY= NEXT_PUBLIC_SEARCH_APPWRITEKEY= NEXT_PUBLIC_SEARCH_APPID= -NEXT_PUBLIC_DOMAIN= \ No newline at end of file +NEXT_PUBLIC_HOME_DOMAIN= \ No newline at end of file diff --git a/document/Dockerfile b/document/Dockerfile index eb28774d1..636293581 100644 --- a/document/Dockerfile +++ b/document/Dockerfile @@ -21,13 +21,13 @@ WORKDIR /app ARG NEXT_PUBLIC_SEARCH_APPKEY ARG NEXT_PUBLIC_SEARCH_APPID -ARG NEXT_PUBLIC_DOMAIN ARG NEXT_PUBLIC_SEARCH_APPWRITEKEY +ARG NEXT_PUBLIC_HOME_DOMAIN ENV NEXT_PUBLIC_SEARCH_APPKEY=$NEXT_PUBLIC_SEARCH_APPKEY ENV NEXT_PUBLIC_SEARCH_APPWRITEKEY=$NEXT_PUBLIC_SEARCH_APPWRITEKEY ENV NEXT_PUBLIC_SEARCH_APPID=$NEXT_PUBLIC_SEARCH_APPID -ENV NEXT_PUBLIC_DOMAIN=$NEXT_PUBLIC_DOMAIN +ENV NEXT_PUBLIC_HOME_DOMAIN=$NEXT_PUBLIC_HOME_DOMAIN COPY . . RUN npm install && npm run build diff --git a/document/README.md b/document/README.md index 2f36fbb09..150a5d3d9 100644 --- a/document/README.md +++ b/document/README.md @@ -24,7 +24,7 @@ NEXT_PUBLIC_SEARCH_APPWRITEKEY = #这是上面获取的Write api key NEXT_PUBLIC_SEARCH_APPKEY = #这是上面获取的搜索key NEXT_PUBLIC_SEARCH_APPID = #这是上面的搜索id -NEXT_PUBLIC_DOMAIN = #要跳转的FastGPT项目的域名,默认海外版 +NEXT_PUBLIC_HOME_DOMAIN = #要跳转的FastGPT项目的域名,默认海外版 ``` 你可以在FastGPT项目根目录下执行以下命令来运行文档。 diff --git a/document/app/global.css b/document/app/global.css index 58ff33e03..0b52976f0 100644 --- a/document/app/global.css +++ b/document/app/global.css @@ -166,17 +166,17 @@ figure.shiki button[aria-label='Copy Text'] { } } #nd-subnav > div:nth-of-type(1) { - border-bottom: 0.1px solid #f4f4f7 !important; + border-bottom: 0.1px solid #e8ebf0 !important; } #nd-subnav > div:nth-of-type(2) { - border-bottom: 0.1px solid #dfe2ea !important; + border-bottom: 0.1px solid #e8ebf0 !important; height: 100%; } .dark #nd-subnav > div:nth-of-type(1) { border-bottom: 0.1px solid #363b4a58 !important; } .dark #nd-subnav > div:nth-of-type(2) { - border-bottom: 0.1px solid #61646fc6 !important; + border-bottom: 0.1px solid #363b4a58 !important; } div[data-rmiz-modal-content] { @@ -195,6 +195,14 @@ div[data-rmiz-modal-overlay='visible'] { background-color: #060c1a00 !important; } +#nd-tocnav { + border-bottom-color: #e8ebf0 !important; +} +.dark #nd-tocnav { + border-bottom-color: #1d2532 !important; + cursor: pointer !important; +} + #nd-subnav > div:nth-of-type(2) a { text-decoration: none; color: #485264; @@ -204,7 +212,7 @@ div[data-rmiz-modal-overlay='visible'] { /* 先清除默认下划线 */ &:hover { text-decoration: underline; - text-decoration-color: #c5d7ff; + text-decoration-color: #dfe2ea; text-decoration-thickness: 3px; /* 下划线粗细 */ text-underline-offset: 17px; /* 下划线与文字距离 */ } diff --git a/document/components/docs/linkFastGPT.tsx b/document/components/docs/linkFastGPT.tsx index 8c01cdce6..baabb9eea 100644 --- a/document/components/docs/linkFastGPT.tsx +++ b/document/components/docs/linkFastGPT.tsx @@ -22,7 +22,7 @@ const hoverStyles: React.CSSProperties = { const FastGPTLink = ({ children, className, style, onClick, ...props }: FastGPTLinkProps) => { const href = useMemo(() => { - return process.env.NEXT_PUBLIC_DOMAIN ?? 'https://fastgpt.io'; + return process.env.NEXT_PUBLIC_HOME_DOMAIN ?? 'https://fastgpt.io'; }, []); const [isHovered, setIsHovered] = React.useState(false); diff --git a/document/content/docs/introduction/development/upgrading/4110.mdx b/document/content/docs/introduction/development/upgrading/4110.mdx index eccfa0167..4aa73a7be 100644 --- a/document/content/docs/introduction/development/upgrading/4110.mdx +++ b/document/content/docs/introduction/development/upgrading/4110.mdx @@ -31,7 +31,7 @@ EVAL_LINE_LIMIT=1000 # 评估文件最大行数 ## 🚀 新增内容 -1. 商业版增加**应用评测(Beta 版)**,可对无交互节点的应用进行有监督评分。 +1. 商业版增加**应用评测(Beta 版)**,可对应用进行有监督评分。 2. 工作流部分节点支持报错捕获分支。 3. 对话页独立 tab 页面UX。 4. 支持 Signoz traces 和 logs 系统追踪。 diff --git a/document/content/docs/introduction/development/upgrading/4111.mdx b/document/content/docs/introduction/development/upgrading/4111.mdx index a58308ede..9ef9b489b 100644 --- a/document/content/docs/introduction/development/upgrading/4111.mdx +++ b/document/content/docs/introduction/development/upgrading/4111.mdx @@ -3,11 +3,10 @@ title: 'V4.11.1(进行中)' description: 'FastGPT V4.11.1 更新说明' --- - - ## 🚀 新增内容 -1. 账号注销 +1. 账号注销。 +2. 新文档框架。 ## ⚙️ 优化 @@ -16,5 +15,4 @@ description: 'FastGPT V4.11.1 更新说明' ## 🐛 修复 - -## 🔨 工具更新 \ No newline at end of file +## 🔨 工具更新 diff --git a/document/next.config.mjs b/document/next.config.mjs index a417b75e7..b5276e3e2 100644 --- a/document/next.config.mjs +++ b/document/next.config.mjs @@ -14,6 +14,7 @@ const withMDX = createMDX({ const config = { output: 'standalone', reactStrictMode: true, + compress: true, images: { unoptimized: true, dangerouslyAllowSVG: true, diff --git a/document/package.json b/document/package.json index a101df8e8..c68784b7e 100644 --- a/document/package.json +++ b/document/package.json @@ -3,7 +3,9 @@ "version": "0.0.0", "private": true, "scripts": { - "build": "next build && node --env-file=.env.local ./update-index.mjs", + "build": "next build", + "update-index-action": "node ./update-index.mjs", + "update-index": "node --env-file=.env.local ./update-index.mjs", "dev": "next dev --turbo", "start": "next start", "postinstall": "fumadocs-mdx"