Commit 5de31a78 authored by AI Bot's avatar AI Bot

CI:预览站也拆中英两份单语言构建,与正式站产物一致

- preview job 改为 SITE_LANG=zh/en 各 build+export,替换原双语构建
- out-zh → 现有 9945 预览目录, out-en → official/en 目录(配 nginx 9946 server 块)
- 预览即所见即所得,不再有双语 toggle 的老机制差异
Co-Authored-By: 's avatarClaude Code <noreply@anthropic.com>
parent f0bce8f5
...@@ -14,6 +14,18 @@ cache: ...@@ -14,6 +14,18 @@ cache:
- node_modules/ - node_modules/
- scripts/.font-cache/ - scripts/.font-cache/
variables:
# 英文站 OSS bucket,上线前改成实际 bucket 名
EN_OSS_BUCKET: "gaorong-web-en"
# 中文站 OSS bucket(现有)
ZH_OSS_BUCKET: "gaorong-web"
cache:
paths:
- out
- node_modules/
- scripts/.font-cache/
compile_articles_and_preview: compile_articles_and_preview:
stage: build stage: build
# when: manual # when: manual
...@@ -27,12 +39,16 @@ compile_articles_and_preview: ...@@ -27,12 +39,16 @@ compile_articles_and_preview:
- node utils/articleAggregate.js - node utils/articleAggregate.js
- sh utils/imageCompress.sh - sh utils/imageCompress.sh
- sh utils/commit.sh - sh utils/commit.sh
- npm run export # 预览与正式站一致:分别出中英文单语言构建(不用 build:zh 脚本,其 Windows set 语法在 Linux 上无效)
- rm -rf /home/gitlab-runner/deploy/cms/official/out #/home/gitlab-runner/deploy/official/out/ - SITE_LANG=zh npm run build
- cp -r out /home/gitlab-runner/deploy/cms/official/ #deploy/official - npx next export -o out-zh
# - rm -r /home/gitlab-runner/deploy/official/out - SITE_LANG=en npm run build
# - cp -r out/ /home/gitlab-runner/deploy/official/ - npx next export -o out-en
- echo "预览网站:http://preview.gaorongvc.cn:9945/" - rm -rf /home/gitlab-runner/deploy/cms/official/out-zh /home/gitlab-runner/deploy/cms/official/out-en
- cp -r out-zh /home/gitlab-runner/deploy/cms/official/
- cp -r out-en /home/gitlab-runner/deploy/cms/official/en
- echo "中文预览网站:http://preview.gaorongvc.cn:9945/"
- echo "英文预览网站:http://preview.gaorongvc.cn:9946/"
# compress_images: # compress_images:
# stage: build # stage: build
...@@ -61,9 +77,9 @@ deploy: ...@@ -61,9 +77,9 @@ deploy:
- npx next export -o out-zh - npx next export -o out-zh
- SITE_LANG=en npm run build - SITE_LANG=en npm run build
- npx next export -o out-en - npx next export -o out-en
- rm -rf /home/gitlab-runner/deploy/cms/official/out #/home/gitlab-runner/deploy/official/out/ - rm -rf /home/gitlab-runner/deploy/cms/official/out-zh /home/gitlab-runner/deploy/cms/official/en
- echo "预览页面已清除" - cp -r out-zh /home/gitlab-runner/deploy/cms/official/
- cp -r out-zh /home/gitlab-runner/deploy/cms/official/out #deploy/official - cp -r out-en /home/gitlab-runner/deploy/cms/official/en
- /home/gitlab-runner/sh/ossutil64 cp -f out-zh oss://$ZH_OSS_BUCKET/ -r - /home/gitlab-runner/sh/ossutil64 cp -f out-zh oss://$ZH_OSS_BUCKET/ -r
- /home/gitlab-runner/sh/ossutil64 cp -f out-en oss://$EN_OSS_BUCKET/ -r - /home/gitlab-runner/sh/ossutil64 cp -f out-en oss://$EN_OSS_BUCKET/ -r
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment