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:
- node_modules/
- 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:
stage: build
# when: manual
......@@ -27,12 +39,16 @@ compile_articles_and_preview:
- node utils/articleAggregate.js
- sh utils/imageCompress.sh
- sh utils/commit.sh
- npm run export
- rm -rf /home/gitlab-runner/deploy/cms/official/out #/home/gitlab-runner/deploy/official/out/
- cp -r out /home/gitlab-runner/deploy/cms/official/ #deploy/official
# - rm -r /home/gitlab-runner/deploy/official/out
# - cp -r out/ /home/gitlab-runner/deploy/official/
- echo "预览网站:http://preview.gaorongvc.cn:9945/"
# 预览与正式站一致:分别出中英文单语言构建(不用 build:zh 脚本,其 Windows set 语法在 Linux 上无效)
- SITE_LANG=zh npm run build
- npx next export -o out-zh
- SITE_LANG=en npm run build
- npx next export -o out-en
- 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:
# stage: build
......@@ -61,9 +77,9 @@ deploy:
- npx next export -o out-zh
- SITE_LANG=en npm run build
- npx next export -o out-en
- rm -rf /home/gitlab-runner/deploy/cms/official/out #/home/gitlab-runner/deploy/official/out/
- echo "预览页面已清除"
- cp -r out-zh /home/gitlab-runner/deploy/cms/official/out #deploy/official
- rm -rf /home/gitlab-runner/deploy/cms/official/out-zh /home/gitlab-runner/deploy/cms/official/en
- cp -r out-zh /home/gitlab-runner/deploy/cms/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-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