ci: deploy to gh pages (#1629)

This commit is contained in:
chilingling 2025-09-15 12:44:34 +08:00 committed by GitHub
parent 3e61fcd06c
commit 451e73cccf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 57 additions and 0 deletions

50
.github/workflows/deploy-gh-pages.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Deploy to GitHub Pages
on:
push:
branches: [develop]
jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
concurrency:
group: deploy-gh-pages
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: add environment variable
run: |
cat <<'EOF' >> designer-demo/env/.env.alpha
// ---- appended by CI (gh-pages) ----
VITE_ORIGIN=https://agent.opentiny.design/
EOF
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha > /tmp/build-alpha.log 2>&1
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./designer-demo/dist/
keep_files: true
force_orphan: false
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

View File

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