实际问题
文件: .github/workflows/deploy.yml
代码:
name: Deploy to GitHub Pages
...
- name: Build
run: npm run make || npm run build || echo "No build script"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
问题:
- This is an Electron desktop application (not a web app), but the workflow deploys to GitHub Pages
npm run make builds native desktop installers (.exe, .dmg, .AppImage), not static web files
- Electron apps cannot run in a browser - they require Node.js/Electron runtime
- The
./out directory assumption is incorrect for electron-forge
改进建议
Option A - For Desktop App: Remove GitHub Pages deployment, use GitHub Releases instead:
name: Build and Release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm install
- run: npm run make
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: molviz-${{ matrix.os }}
path: out/make/**
Option B - For Web App: If you want a web version, create a separate web build using Vite/Webpack that bundles the Three.js renderer for browser-only usage.
为什么重要
- Severity: HIGH - Current workflow will fail or produce broken deployments
- Electron apps deployed to GitHub Pages simply won't work
- Users downloading from GitHub Pages will get non-functional files
- Wastes CI/CD resources on incorrect deployment approach
优先级
实际问题
文件:
.github/workflows/deploy.yml代码:
问题:
npm run makebuilds native desktop installers (.exe, .dmg, .AppImage), not static web files./outdirectory assumption is incorrect for electron-forge改进建议
Option A - For Desktop App: Remove GitHub Pages deployment, use GitHub Releases instead:
Option B - For Web App: If you want a web version, create a separate web build using Vite/Webpack that bundles the Three.js renderer for browser-only usage.
为什么重要
优先级