forked from opentiny/tiny-engine
ci: deploy to gh pages (#1629)
This commit is contained in:
parent
3e61fcd06c
commit
451e73cccf
|
|
@ -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'
|
||||
|
|
@ -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' : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue