[pull] next from kongying-tavern:next #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compressed Size | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
with: | |
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
# cache node_modules | |
- name: Cache pnpm modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- name: Install dependencies | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: true | |
- name: Build Site | |
run: pnpm build | |
- uses: preactjs/compressed-size-action@v2 | |
with: | |
clean-script: 'rm -rf dist/' | |
pattern: './build/**/*.{js,css,html,json}' | |
exclude: '{./build-output/manifest.json,**/*.map,**/node_modules/**}' |