配置新的部署方式

This commit is contained in:
sijinhui 2024-01-04 10:56:49 +08:00
parent b1198dab55
commit 167b86642b
2 changed files with 23 additions and 8 deletions

View File

@ -45,7 +45,7 @@ jobs:
uses: webfactory/ssh-agent@v0.8.0 uses: webfactory/ssh-agent@v0.8.0
with: with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Sync repository to ty - name: Sync repository to tx
run: | run: |
yes | docker image prune yes | docker image prune
rsync -az -e 'ssh -o StrictHostKeyChecking=no' --delete $GITHUB_WORKSPACE/ root@tx.xiaosi.cc:/data/ChatGPT-Next-Web rsync -az -e 'ssh -o StrictHostKeyChecking=no' --delete $GITHUB_WORKSPACE/ root@tx.xiaosi.cc:/data/ChatGPT-Next-Web
@ -61,13 +61,7 @@ jobs:
script: | script: |
cd $SERVER_WORKDIR #进入到工作目录 cd $SERVER_WORKDIR #进入到工作目录
echo "${{ secrets.DOCKER_ENV }}" > .env echo "${{ secrets.DOCKER_ENV }}" > .env
#echo ${{ secrets.ALY_DOCKER_PASSWORD }} | docker login registry.cn-hangzhou.aliyuncs.com -u ${{ secrets.ALY_DOCKER_USERNAME }} --password-stdin bash ./start.sh
#docker-compose pull && docker-compose up -d
#yes | docker image prune
yarn config set registry 'https://registry.npmmirror.com/'
yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
yarn install && yarn run build
rm -rf /www/server/nginx/proxy_cache_dir/* rm -rf /www/server/nginx/proxy_cache_dir/*
rm -rf /www/server/nginx/proxy_temp_dir/* rm -rf /www/server/nginx/proxy_temp_dir/*
sleep 2 sleep 2

21
start.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
yarn config set registry 'https://registry.npmmirror.com/'
yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
#yarn cache clean
yarn install
yarn run build
mkdir -p "./node_modules/tiktoken"
export OUT_DIR="out"
mkdir -p ${OUT_DIR}
rsync -az --delete ./.next/standalone/ ${OUT_DIR}
rsync -az --delete ./public/ ${OUT_DIR}/public
rsync -az --delete ./.next/static/ ${OUT_DIR}/.next/static
rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server
rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server
rsync -az --delete "./node_modules/tiktoken/" ${OUT_DIR}/node_modules/tiktoken