Skip to content

Commit

Permalink
Merge pull request #2 from c121914yu/main
Browse files Browse the repository at this point in the history
fastgptHome
  • Loading branch information
c121914yu authored Jan 1, 2024
2 parents 789d6da + eb1e1dc commit f3ce271
Show file tree
Hide file tree
Showing 149 changed files with 28,929 additions and 5,223 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/fastgpt-home-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build xiaoyi page images in Personal warehouse
on:
workflow_dispatch:
push:
paths:
- 'projects/xiaoyi/**'
branches:
- 'main'
jobs:
build-fastgpt-images:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: Set DOCKER_REPO_TAGGED based on branch or tag
run: |
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-home:xiaoyi" >> $GITHUB_ENV
- name: Build and publish image for main branch or tag push event
env:
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
run: |
cd projects/xiaoyi && docker buildx build \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
--label "org.opencontainers.image.description=fastgpt-home image" \
--push \
--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache \
-t ${DOCKER_REPO_TAGGED} \
-f Dockerfile \
.
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"editor.formatOnSave": true,
"editor.mouseWheelZoom": true,
"typescript.tsdk": "node_modules/typescript/lib",
"prettier.prettierPath": "./node_modules/prettier",
"i18n-ally.localesPaths": [
"projects/*/public/locales"
"projects/fastgpt/public/locales"
],
"i18n-ally.keystyle": "nested"
"i18n-ally.enabledParsers": ["json"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.keepFulfilled": true,
"i18n-ally.sourceLanguage": "zh", // 根据此语言文件翻译其他语言文件的变量和内容
"i18n-ally.displayLanguage": "en", // 显示语言
}
78 changes: 76 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pnpm-workspace.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions projects/fastgpt/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 首页路径
HOME_URL=/
SYSTEM_NAME=FAI
SYSTEM_FAVICON=/favicon.ico
6 changes: 6 additions & 0 deletions projects/fastgpt/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "next/core-web-vitals",
"rules": {
"react-hooks/rules-of-hooks": 0
}
}
32 changes: 32 additions & 0 deletions projects/fastgpt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# dependencies
node_modules/
# next.js
.next/
out/
# production
build/

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
platform.json
testApi/
local/
.husky/
data/*.local.*
15 changes: 15 additions & 0 deletions projects/fastgpt/next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//next-i18next.config.js
/**
* @type {import('next-i18next').UserConfig}
*/

module.exports = {
i18n: {
defaultLocale: 'zh',
locales: ['en', 'zh'],
localeDetection: false
},
localePath:
typeof window === 'undefined' ? require('path').resolve('./public/locales') : '/public/locales',
reloadOnPrerender: process.env.NODE_ENV === 'development'
};
37 changes: 37 additions & 0 deletions projects/fastgpt/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/** @type {import('next').NextConfig} */
const { i18n } = require('./next-i18next.config');
const path = require('path');

const nextConfig = {
i18n,
// output: 'standalone',
reactStrictMode: process.env.NODE_ENV === 'development' ? false : true,
compress: true,
webpack(config, { isServer }) {
if (!isServer) {
config.resolve = {
...config.resolve,
fallback: {
...config.resolve.fallback,
fs: false
}
};
}
config.module = {
...config.module,
rules: config.module.rules.concat([
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack']
}
]),
exprContextCritical: false,
unknownContextCritical: false
};

return config;
}
};

module.exports = nextConfig;
Loading

0 comments on commit f3ce271

Please sign in to comment.