mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 13:19:20 +00:00
44 lines
830 B
YAML
44 lines
830 B
YAML
name: Deploy React App
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
# defaults:
|
|
#run:
|
|
# working-directory: src/frontend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# 调试:检查文件结构(临时添加)
|
|
- name: Debug - Check files
|
|
run: |
|
|
echo "Root directory:"
|
|
ls -la
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build
|
|
run: pnpm run build
|
|
|
|
- name: Deploy
|
|
run: npx gh-pages -d build
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|