From 67c38b0564ba7388058ca896498bc26a7fb3e35f Mon Sep 17 00:00:00 2001 From: chu fan Date: Mon, 16 Oct 2023 18:49:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20ci=E8=84=9A=E6=9C=AC=E6=96=B0=E5=A2=9Ep?= =?UTF-8?q?npm=E5=AE=89=E8=A3=85=EF=BC=8C=E4=BC=98=E5=8C=96CI=E3=80=81CD?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yaml | 32 +++++++++++++++++--------------- .github/workflows/CI.yml | 29 +++++++++++++++-------------- scripts/ci | 2 +- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index d11cadb..890712d 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -32,21 +32,23 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 - ## 依赖下载完成后,或执行思维导图编译 - - name: PNPM Install - uses: pnpm/action-setup@v2 - with: - version: 7 - run_install: | - args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] - - # - name: Install Node.js - # uses: actions/setup-node@v3 + # ## 依赖下载完成后,或执行思维导图编译 + # - name: PNPM Install + # uses: pnpm/action-setup@v2 # with: - # node-version: 18.18.0 - # ## 淘宝镜像加速 - # registry-url: 'https://registry.npmmirror.com' - # cache: 'pnpm' + # version: 7 + # run_install: | + # args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] + + # 安装Node环境 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.18.0 + ## 淘宝镜像加速 + registry-url: 'https://registry.npmmirror.com' + + - run: ./scripts/ci # 运行构建脚本 - name: Build VuePress Site @@ -75,7 +77,7 @@ jobs: ## 注意: 这里的操作时间vercel平台配置的命令拉取下来,执行 - name: Pull Vercel Environment Information - run: npm i vercel -g && vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + run: npm i -g vercel && vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} ## 执行vercel平台配置的命令 - name: Build Project Artifacts diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e2bf18c..d2de991 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,21 +33,22 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 - ## 依赖下载完成后,或执行思维导图编译 - - name: PNPM Install - uses: pnpm/action-setup@v2 - with: - version: 7 - run_install: | - args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] - - # - name: Install Node.js - # uses: actions/setup-node@v3 + # ## 依赖下载完成后,或执行思维导图编译 + # - name: PNPM Install + # uses: pnpm/action-setup@v2 # with: - # node-version: 18.18.0 - # ## 淘宝镜像加速 - # registry-url: 'https://registry.npmmirror.com' - # cache: 'pnpm' + # version: 7 + # run_install: | + # args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] + # 安装Node环境 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.18.0 + ## 淘宝镜像加速 + registry-url: 'https://registry.npmmirror.com' + + - run: ./scripts/ci - name: Cache Dependencies uses: actions/cache@v3 diff --git a/scripts/ci b/scripts/ci index 9286361..d7909c0 100755 --- a/scripts/ci +++ b/scripts/ci @@ -1,4 +1,4 @@ #!/bin/bash ## 下载依赖 -pnpm i --frozen-lockfile --registry https://registry.npmmirror.com \ No newline at end of file +npm i -g pnpm@7 && pnpm i --frozen-lockfile --registry https://registry.npmmirror.com \ No newline at end of file