Skip to content

Commit

Permalink
wip: ci-14
Browse files Browse the repository at this point in the history
  • Loading branch information
EmbraceAn committed Nov 4, 2024
1 parent aef1e4f commit 2174b68
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
name: Build and Deploy
on: # 监听 main 分支上的 push 事件

on:
push:
branches:
- feat/taskList

jobs:
build-and-deploy:
runs-on: ubuntu-latest # 构建环境使用 ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Install and Build # 下载依赖 打包项目
# 安装 Node.js 和 pnpm
- name: Install Node.js 22.7
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 22.7
nvm use 22.7
node -v # 验证 Node 版本
- name: Install pnpm 9.9
run: |
npm install -g pnpm
pnpm install --frozen-lockfile # 确保使用锁文件安装
pnpm run build
npm install -g [email protected]
pnpm -v # 验证 pnpm 版本
- name: List files in src
run: ls -R src # 输出 src 目录中的文件,调试用
# 安装依赖并构建项目
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build project
run: pnpm build

# 调试:列出 src 目录结构
- name: List files in src directory
run: ls -R src

# 静态文件压缩
- name: pack out file
- name: Pack output files
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: tar -zcvf out.tgz dist

# 清理缓存(可选步骤)
- name: Clean pnpm cache
run: pnpm store prune

0 comments on commit 2174b68

Please sign in to comment.