Skip to content

build(deps-dev): bump vite-plugin-pwa from 0.21.2 to 1.0.3 #15

build(deps-dev): bump vite-plugin-pwa from 0.21.2 to 1.0.3

build(deps-dev): bump vite-plugin-pwa from 0.21.2 to 1.0.3 #15

Workflow file for this run

name: PULL_REQUEST
on:
pull_request:
branches: [develop, main]
types: [opened, synchronize, reopened]
jobs:
lint:
# 在最新版本的 Ubuntu 环境中运行
runs-on: ubuntu-latest
steps:
# 检出代码仓库,并递归初始化子模块
- uses: actions/checkout@v4
with:
submodules: recursive
# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
# 设置 Node.js 环境,版本为 18
- uses: actions/setup-node@v4
with:
node-version: 18
# 获取 pnpm 的存储目录路径
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# 设置 pnpm 缓存
- uses: actions/cache@v4
name: Setup pnpm cache
with:
# 缓存路径
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# 缓存键
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# 恢复缓存的备用键
restore-keys: |
${{ runner.os }}-pnpm-store-
# 安装依赖
- run: pnpm i
# 运行代码 lint 检查
- run: pnpm run lint
build:
# 在最新版本的 Ubuntu 环境中运行
runs-on: ubuntu-latest
# 如果需要依赖自身任务,可以取消注释(通常不需要)
# needs: build
steps:
- name: Save PR number
run: echo ${{ github.event.number }} > ./pr-id.txt
- name: Upload PR number
uses: actions/upload-artifact@v4
with:
name: pr
path: ./pr-id.txt
# 检出代码仓库,并递归初始化子模块
- uses: actions/checkout@v4
with:
submodules: recursive
# 设置 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
# 设置 Node.js 环境,版本为 18
- uses: actions/setup-node@v4
with:
node-version: 18
# 获取 pnpm 的存储目录路径
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# 设置 pnpm 缓存
- uses: actions/cache@v4
name: Setup pnpm cache
with:
# 缓存路径
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# 缓存键
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# 恢复缓存的备用键
restore-keys: |
${{ runner.os }}-pnpm-store-
# 安装依赖
- run: pnpm i
# 运行构建任务
- name: Build
run: pnpm run build
- run: |
zip -r preview.zip ./packages/client/dist
# 上传站点文件作为构建产物
- name: upload preview site artifact
uses: actions/upload-artifact@v4
with:
# 产物名称
name: preview
# 产物路径
path: preview.zip
# 产物保留天数
retention-days: 5