Skip to content

feat: 更新Vite配置以优化构建和缓存策略 #10

feat: 更新Vite配置以优化构建和缓存策略

feat: 更新Vite配置以优化构建和缓存策略 #10

Workflow file for this run

name: Test and Deploy to GitHub Pages
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
# 设置GITHUB_TOKEN的权限
permissions:
contents: read
pages: write
id-token: write
jobs:
test-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Setup Pages
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
id: deployment
uses: actions/deploy-pages@v4