更新文档:1. 添加隐藏变量选择和隐藏虚拟键盘的配置项;2. 增加初始设置示例,便于用户理解;3. 更新接口文档以反映新选项。 #131
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Demo Page | |
on: | |
# 手动触发 | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- 'src/**' | |
- 'public/**' | |
- 'index.html' | |
- 'vite.config.ts' | |
- 'package.json' | |
- '.github/workflows/deploy-demo.yml' | |
- '!**.md' | |
- '!.gitignore' | |
- '!.editorconfig' | |
- '!LICENSE' | |
jobs: | |
build-and-deploy: | |
# 只在手动触发或提交信息包含[deploy]时运行 | |
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[deploy]') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
registry-url: 'https://registry.npmjs.org' | |
# 在 CI 环境中使用 npm 官方源 | |
- name: Configure npm for CI | |
run: | | |
echo "registry=https://registry.npmjs.org/" > .npmrc | |
echo "strict-ssl=true" >> .npmrc | |
- name: Install Dependencies | |
run: npm ci | |
# 类型检查可选,如果当前有类型错误可以暂时注释掉 | |
# - name: Type Check | |
# run: npm run type-check | |
- name: Build Demo | |
run: npm run build:demo | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
publish_dir: ./demo-dist | |
force_orphan: true | |
# 工作流完成后恢复原始 .npmrc | |
- name: Restore original .npmrc | |
if: always() | |
run: | | |
if [ -f .npmrc.backup ]; then | |
mv .npmrc.backup .npmrc | |
fi |