ci: fix Dockerfile & ci

This commit is contained in:
JustSong 2024-01-01 19:23:46 +08:00
parent aa03c89133
commit 83f95935de
6 changed files with 38 additions and 18 deletions

View File

@ -7,6 +7,11 @@ on:
tags: tags:
- '*' - '*'
- '!*-alpha*' - '!*-alpha*'
workflow_dispatch:
inputs:
name:
description: 'reason'
required: false
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,10 +27,10 @@ jobs:
env: env:
CI: "" CI: ""
run: | run: |
cd web/default cd web
npm install git describe --tags > VERSION
REACT_APP_VERSION=$(git describe --tags) npm run build REACT_APP_VERSION=$(git describe --tags) chmod u+x ./build.sh && ./build.sh
cd ../.. cd ..
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:

View File

@ -7,6 +7,11 @@ on:
tags: tags:
- '*' - '*'
- '!*-alpha*' - '!*-alpha*'
workflow_dispatch:
inputs:
name:
description: 'reason'
required: false
jobs: jobs:
release: release:
runs-on: macos-latest runs-on: macos-latest
@ -22,10 +27,10 @@ jobs:
env: env:
CI: "" CI: ""
run: | run: |
cd web/default cd web
npm install git describe --tags > VERSION
REACT_APP_VERSION=$(git describe --tags) npm run build REACT_APP_VERSION=$(git describe --tags) chmod u+x ./build.sh && ./build.sh
cd ../.. cd ..
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:

View File

@ -7,6 +7,11 @@ on:
tags: tags:
- '*' - '*'
- '!*-alpha*' - '!*-alpha*'
workflow_dispatch:
inputs:
name:
description: 'reason'
required: false
jobs: jobs:
release: release:
runs-on: windows-latest runs-on: windows-latest

View File

@ -3,16 +3,7 @@ FROM node:16 as builder
WORKDIR /build WORKDIR /build
COPY ./web . COPY ./web .
COPY ./VERSION . COPY ./VERSION .
RUN themes=$(cat THEMES) \ RUN chmod u+x ./build.sh && ./build.sh
&& IFS=$'\n' \
&& for theme in $themes; do \
theme_path="web/$theme" \
&& echo "Building theme: $theme" \
&& cd $theme_path \
&& npm install \
&& DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build \
&& cd /app \
done
FROM golang AS builder2 FROM golang AS builder2

View File

@ -99,6 +99,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
+ 邮箱登录注册(支持注册邮箱白名单)以及通过邮箱进行密码重置。 + 邮箱登录注册(支持注册邮箱白名单)以及通过邮箱进行密码重置。
+ [GitHub 开放授权](https://github.com/settings/applications/new)。 + [GitHub 开放授权](https://github.com/settings/applications/new)。
+ 微信公众号授权(需要额外部署 [WeChat Server](https://github.com/songquanpeng/wechat-server))。 + 微信公众号授权(需要额外部署 [WeChat Server](https://github.com/songquanpeng/wechat-server))。
23. 支持主题切换,设置环境变量 `THEME` 即可,默认为 `default`,欢迎 PR 更多主题,具体参考[此处](./web/README.md)。
## 部署 ## 部署
### 基于 Docker 进行部署 ### 基于 Docker 进行部署

13
web/build.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
version=$(cat VERSION)
themes=$(cat THEMES)
IFS=$'\n'
for theme in $themes; do
echo "Building theme: $theme"
cd $theme
npm install
DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$version npm run build
cd ..
done