Skip to content

Commit

Permalink
Merge pull request #110 from ZhQuella/main-feat/new
Browse files Browse the repository at this point in the history
Main feat/new
  • Loading branch information
ZhQuella authored Feb 11, 2025
2 parents c703b48 + 28c2e92 commit 991fb58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 43 deletions.
51 changes: 9 additions & 42 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,56 +28,23 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# 检出代码
- name: Checkout
uses: actions/checkout@v3

# 设置 pnpm
- name: Set up pnpm
uses: pnpm/[email protected]
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 8.6.2

# 缓存 pnpm 的 node_modules,提升构建速度
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# 安装依赖
- name: Install dependencies
- name: Install modules
run: pnpm install --no-frozen-lockfile

# 构建项目
- name: Build project
- name: Build
run: pnpm run build

# 检查目录存在性
- name: List build directory
run: ls -R ${{ github.workspace }}/sample/dist

# 输出调试信息到环境变量
- name: Set debug output
run: echo "UPLOAD_PATH=${{ github.workspace }}/sample/dist" >> $GITHUB_ENV

# 设置 Pages
- name: Setup Pages
uses: actions/configure-pages@v4

# 上传构建产物
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v1
with:
path: ${{ github.workspace }}/sample/dist
artifact_name: dist
continue-on-error: true

# 部署到 GitHub Pages
# Upload dist repository
path: "./sample/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
with:
artifact_name: dist
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "grow_admin",
"private": true,
"version": "1.0.0",
"type": "module",
"type": "commonjs",
"description": "",
"author": "ZhQuella (Email:[email protected])",
"main": "index.js",
Expand Down

0 comments on commit 991fb58

Please sign in to comment.