Skip to content

Commit

Permalink
Merge pull request #44 from zjy365/dev
Browse files Browse the repository at this point in the history
upadte env
  • Loading branch information
yangchuansheng authored Aug 30, 2024
2 parents 90455b4 + 9123bf6 commit ab7e901
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 63 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_dispatch:
push:
paths:
- 'projects/fastgpt/**'
- "projects/fastgpt/**"
branches:
- 'main'
- "main"

jobs:
deploy:
Expand All @@ -16,6 +16,9 @@ jobs:
uses: actions/checkout@v4

- name: Build
env:
NEXT_PUBLIC_HOME_URL: https://tryfastgpt.ai
NEXT_PUBLIC_USER_URL: https://cloud.fastgpt.in
run: |
cd projects/fastgpt
npm install
Expand All @@ -25,4 +28,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PAT }}
publish_dir: ./projects/fastgpt/out
publish_dir: ./projects/fastgpt/out
2 changes: 2 additions & 0 deletions .github/workflows/fastgpt-home-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ jobs:
build-args: |
NEXT_PUBLIC_BAIDU_TONGJI=${{ secrets.NEXT_PUBLIC_BAIDU_TONGJI }}
NEXT_PUBLIC_BAIDU_KEY=${{ secrets.NEXT_PUBLIC_BAIDU_KEY }}
NEXT_PUBLIC_HOME_URL=${{ secrets.NEXT_PUBLIC_HOME_URL }}
NEXT_PUBLIC_USER_URL=${{ secrets.NEXT_PUBLIC_USER_URL }}
7 changes: 4 additions & 3 deletions projects/fastgpt/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SITE_URL=

NEXT_PUBLIC_BAIDU_TONGJI=
NEXT_PUBLIC_GOOGLE_ID=
NEXT_PUBLIC_GOOGLE_ID=

NEXT_PUBLIC_HOME_URL=
NEXT_PUBLIC_USER_URL=
6 changes: 5 additions & 1 deletion projects/fastgpt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ WORKDIR /app

ARG NEXT_PUBLIC_BAIDU_TONGJI
ARG NEXT_PUBLIC_BAIDU_KEY
ARG NEXT_PUBLIC_HOME_URL
ARG NEXT_PUBLIC_USER_URL

ENV NEXT_PUBLIC_BAIDU_TONGJI=$NEXT_PUBLIC_BAIDU_TONGJI
ENV NEXT_PUBLIC_BAIDU_KEY=$NEXT_PUBLIC_BAIDU_KEY
ENV NEXT_PUBLIC_HOME_URL=$NEXT_PUBLIC_HOME_URL
ENV NEXT_PUBLIC_USER_URL=$NEXT_PUBLIC_USER_URL

# copy packages and one project
ADD . ./

RUN sed -i "s#https://fastgpt.in#https://fastgpt.cn#g" $(grep -rl "https://fastgpt.in" ./)

RUN sed -i "s#https://doc.fastgpt.in#https://doc.fastgpt.cn#g" $(grep -rl "https://doc.fastgpt.in" ./)
RUN sed -i "s/defaultLocale = \"en\"/defaultLocale = \"zh\"/g" lib/i18n.ts

Expand Down
3 changes: 2 additions & 1 deletion projects/fastgpt/components/home/CTAButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';
import { Button } from '@/components/ui/button';
import { siteConfig } from '@/config/site';
import { RocketIcon } from 'lucide-react';
import Link from 'next/link';
import { useEffect, useState } from 'react';
Expand All @@ -23,7 +24,7 @@ const CTAButton = ({ locale, stars: initialStars }: { locale: any; stars: number

return (
<div className="flex items-center gap-4">
<Link href="https://cloud.fastgpt.in" rel="noopener noreferrer nofollow">
<Link href={siteConfig.userUrl} rel="noopener noreferrer nofollow">
<Button
variant="default"
className="flex items-center gap-2 bg-blue-500 hover:bg-blue-600 text-white px-8 py-6 text-base"
Expand Down
26 changes: 22 additions & 4 deletions projects/fastgpt/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,33 @@ const baseSiteConfig = {
name: 'FastGPT',
description:
'A free, open-source, and powerful AI knowledge base platform, offers out-of-the-box data processing, model invocation, RAG retrieval, and visual AI workflows. Easily build complex Q&A systems.',
url: 'https://fastgpt.in',
url: process.env.NEXT_PUBLIC_HOME_URL || 'https://fastgpt.in',
userUrl: process.env.NEXT_PUBLIC_USER_URL || 'https://cloud.fastgpt.in',
ogImage: 'https://landingpage.weijunext.com/og.png',
metadataBase: '/',
keywords: ["rag", "ai", "workflow", "llm", "gpt", "gpt4", "orchestration","FastGPT","free","知识库","问答","数据处理","模型调用","RAG检索","可视化AI工作流","企业知识库"],
commercial: "https://doc.fastgpt.in/docs/commercial/intro/",
keywords: [
'rag',
'ai',
'workflow',
'llm',
'gpt',
'gpt4',
'orchestration',
'FastGPT',
'free',
'知识库',
'问答',
'数据处理',
'模型调用',
'RAG检索',
'可视化AI工作流',
'企业知识库'
],
commercial: 'https://doc.fastgpt.in/docs/commercial/intro/',
authors: [
{
name: 'labring',
url: 'https://fastgpt.in',
url: process.env.NEXT_PUBLIC_HOME_URL || '',
twitter: 'https://github.com/labring/FastGPT'
}
],
Expand Down
4 changes: 2 additions & 2 deletions projects/fastgpt/next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('next-sitemap').IConfig} */

module.exports = {
siteUrl: process.env.SITE_URL || "https://fastgpt.in",
siteUrl: process.env.NEXT_PUBLIC_HOME_URL || "https://fastgpt.in",
generateRobotsTxt: true,
sitemapSize: 7000,
};
}
99 changes: 50 additions & 49 deletions projects/fastgpt/types/siteConfig.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,59 @@
import { IconType } from "react-icons"
import { IconType } from 'react-icons';

export type AuthorsConfig = {
name: string
url: string
twitter?: string
}
name: string;
url: string;
twitter?: string;
};
export type ProductLink = {
url: string
name: string
}
url: string;
name: string;
};
export type Link = {
name: string
href: string
icon: IconType
}
name: string;
href: string;
icon: IconType;
};
export type ThemeColor = {
media: string
color: string
}
media: string;
color: string;
};
export type SiteConfig = {
name: string
description: string
url: string
keywords: string[]
commercial: string
authors: AuthorsConfig[]
creator: string
openSourceURL?: string
ogImage: string
headerLinks: Link[]
footerLinks: Link[],
footerProducts: ProductLink[]
metadataBase: URL | string
themeColors?: string | ThemeColor[]
nextThemeColor?: string
name: string;
description: string;
url: string;
userUrl: string;
keywords: string[];
commercial: string;
authors: AuthorsConfig[];
creator: string;
openSourceURL?: string;
ogImage: string;
headerLinks: Link[];
footerLinks: Link[];
footerProducts: ProductLink[];
metadataBase: URL | string;
themeColors?: string | ThemeColor[];
nextThemeColor?: string;
icons: {
icon: string
shortcut?: string
apple?: string
}
icon: string;
shortcut?: string;
apple?: string;
};
openGraph: {
type: string
locale: string
url: string
title: string
description: string
siteName: string
images?: string[]
},
type: string;
locale: string;
url: string;
title: string;
description: string;
siteName: string;
images?: string[];
};
twitter: {
card: string
title: string
description: string
images?: string[]
creator: string
},
}
card: string;
title: string;
description: string;
images?: string[];
creator: string;
};
};

0 comments on commit ab7e901

Please sign in to comment.