Skip to content

fix: 修复 Prettier 配置和文件扩展名问题 #2

fix: 修复 Prettier 配置和文件扩展名问题

fix: 修复 Prettier 配置和文件扩展名问题 #2

Workflow file for this run

name: Deploy to GitHub Pages
on:
# 推送到 main 分支时触发
push:
branches: [ main ]
# 手动触发部署
workflow_dispatch:
# 设置权限
permissions:
contents: read
pages: write
id-token: write
# 并发控制
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取所有历史记录,用于更好的缓存
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --prefer-offline
- name: Build with Vite
run: npm run build
env:
# 设置正确的 base URL 用于 GitHub Pages
VITE_BASE_URL: /bigTableRender/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4