ci: config material url on gh page workflow (#1630)

This commit is contained in:
chilingling 2025-09-15 14:54:56 +08:00 committed by GitHub
parent 451e73cccf
commit 3752fbac3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -35,9 +35,15 @@ jobs:
// ---- appended by CI (gh-pages) ----
VITE_ORIGIN=https://agent.opentiny.design/
EOF
- name: change material url
run: |
sed -i "s#material: \['/mock/bundle.json'\]#material: \['https://opentiny.github.io/tiny-engine/mock/bundle.json'\]#g" designer-demo/engine.config.js
echo "Updated material url in designer-demo/engine.config.js"
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha > /tmp/build-alpha.log 2>&1
run: |
set -eo pipefail
pnpm run build:plugin 2>&1 | tee /tmp/build-plugin.log
pnpm run build:alpha 2>&1 | tee /tmp/build-alpha.log
- name: Deploy
uses: peaceiris/actions-gh-pages@v4

View File

@ -48,7 +48,7 @@ export default {
options: {
// 配置预览跳转的 url
// 文档https://opentiny.design/tiny-engine#/help-center/course/dev/preview-api
previewUrl: ['prod', 'alpha'].includes(import.meta.env.MODE) ? './preview.html' : ''
previewUrl: ['prod', 'alpha'].includes(import.meta.env.MODE) ? `${import.meta.env.BASE_URL || '.'}/preview.html` : ''
}
}
}