feat: 更新 Playwright 工作流以计算构建大小;添加 vite-plugin-purgecss-updated-v5 插件
Some checks failed
/ surge (push) Successful in 2m24s
/ lint-build-and-check (push) Successful in 2m37s
/ depcheck (push) Successful in 2m43s
/ build-and-deploy-to-vercel (push) Successful in 2m47s
/ playwright (push) Has been cancelled

This commit is contained in:
mini2024
2025-03-22 23:47:21 +08:00
parent 9e6d526ada
commit d23fcd72c7
4 changed files with 88 additions and 6 deletions

View File

@ -19,13 +19,13 @@ jobs:
env:
VITE_BUILD_COMMIT: ${{ github.sha }}
- name: 计算构建大小
working-directory: dist
run: |
set -x
du -sk . | cut -f1 # 以千字节(KB)为单位
du -sm . | cut -f1 # 以兆字节(MB)为单位
du -s --si . | cut -f1 # 使用SI单位(基于1000而非1024)
du -sh . | cut -f1 # 以人类可读的方式
echo "📊 构建大小统计:"
echo "----------------------------------------"
echo "🔹 人类可读格式: $(du -sh dist | cut -f1)"
echo "🔹 以MB为单位: $(du -sm dist | cut -f1) MB"
echo "🔹 文件总数: $(find dist -type f | wc -l) 个文件"
echo "----------------------------------------"
- name: 部署到 Surge
id: surge_deploy
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps