feat: 添加构建大小计算步骤;更新依赖项,新增 vite-plugin-singlefile 插件
All checks were successful
/ lint-build-and-check (push) Successful in 2m25s
/ depcheck (push) Successful in 2m43s
/ build-and-deploy-to-vercel (push) Successful in 3m13s
/ playwright (push) Successful in 3m11s
/ surge (push) Successful in 2m27s

This commit is contained in:
mini2024
2025-03-22 23:44:06 +08:00
parent 974f05719e
commit 9e6d526ada
4 changed files with 46 additions and 14 deletions

View File

@ -1,10 +1,13 @@
defaults:
run:
shell: bash
env:
TZ: Asia/Shanghai
on:
push:
jobs:
surge:
runs-on: ubuntu-latest
@ -15,6 +18,14 @@ jobs:
- run: pnpm run build-only
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 # 以人类可读的方式
- name: 部署到 Surge
id: surge_deploy
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps