Commit f0bce8f5 authored by AI Bot's avatar AI Bot

CI:deploy 阶段改为中英文两份构建分别推送 OSS

- SITE_LANG=zh/en 各 build+export 一份(out-zh/out-en),Linux 语法前置环境变量——不能复用 build:zh 脚本,其 Windows set 语法在 runner 上不生效
- 中文站仍推 oss://gaorong-web(ZH_OSS_BUCKET),英文站推 oss://$EN_OSS_BUCKET(bucket 名待定,可在 variables 里改)
- 预览站保持原双语构建不变,CMS 编辑预览习惯不受影响
Co-Authored-By: 's avatarClaude Code <noreply@anthropic.com>
parent d1a26194
...@@ -2,6 +2,12 @@ stages: ...@@ -2,6 +2,12 @@ stages:
- build - build
- deploy - deploy
variables:
# 英文站 OSS bucket,上线前改成实际 bucket 名
EN_OSS_BUCKET: "gaorong-web-en"
# 中文站 OSS bucket(现有)
ZH_OSS_BUCKET: "gaorong-web"
cache: cache:
paths: paths:
- out - out
...@@ -50,11 +56,16 @@ deploy: ...@@ -50,11 +56,16 @@ deploy:
script: script:
- yarn - yarn
# - sh utils/imageCompress.sh # - sh utils/imageCompress.sh
- npm run export # 注意:不能用 npm run 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 #/home/gitlab-runner/deploy/official/out/ - rm -rf /home/gitlab-runner/deploy/cms/official/out #/home/gitlab-runner/deploy/official/out/
- echo "预览页面已清除" - echo "预览页面已清除"
- cp -r out /home/gitlab-runner/deploy/cms/official/ #deploy/official - cp -r out-zh /home/gitlab-runner/deploy/cms/official/out #deploy/official
- /home/gitlab-runner/sh/ossutil64 cp -f out oss://gaorong-web/ -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
# preview: # preview:
......
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