diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index f7cf9a68..d11cadb8 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -19,47 +19,9 @@ env: VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} jobs: - install-init: - name: "依赖安装初始化" - runs-on: macos-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - persist-credentials: false - # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 - fetch-depth: 0 - - - name: PNPM Install - uses: pnpm/action-setup@v2 - with: - version: 7 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.18.0 - ## 淘宝镜像加速 - registry-url: 'https://registry.npmmirror.com' - cache: 'pnpm' - - - name: Install Dependencies - run: | - pnpm i --frozen-lockfile --registry https://registry.npmmirror.com - - - name: Cache Dependencies - uses: actions/cache@v3 - with: - path: | - node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} - ## 部署到Github-Pages deploy-github: name: "部署到Github-Pages" - needs: - - install-init runs-on: macos-latest steps: @@ -70,18 +32,21 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 - - name: Restore Dependencies From cache - uses: actions/cache@v3 + ## 依赖下载完成后,或执行思维导图编译 + - name: PNPM Install + uses: pnpm/action-setup@v2 with: - path: | - node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} - + version: 7 + run_install: | + args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] - ## 支持思维导图转化 - - name: Build Mark-Map - run: | - ./scripts/mark-map + # - name: Install Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 18.18.0 + # ## 淘宝镜像加速 + # registry-url: 'https://registry.npmmirror.com' + # cache: 'pnpm' # 运行构建脚本 - name: Build VuePress Site @@ -98,8 +63,6 @@ jobs: ## 部署到vercel平台 deploy-vercel: name: "部署到Vercel平台" - needs: - - install-init runs-on: macos-latest if: github.repository == '142vip/408CSFamily' steps: @@ -110,34 +73,22 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 - - name: Restore Dependencies From cache - uses: actions/cache@v3 - with: - path: | - node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }} - - ## 支持思维导图转化 - - name: Build Mark-Map - run: | - ./scripts/mark-map - + ## 注意: 这里的操作时间vercel平台配置的命令拉取下来,执行 - name: Pull Vercel Environment Information - run: vercel -v && vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + run: npm i vercel -g && vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - ## 注意:安装pnpm + ## 执行vercel平台配置的命令 - name: Build Project Artifacts run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + ## dist文件同步到vercel平台 - name: Deploy Project Artifacts to Vercel run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} ## 版本发布 release: - name: "创建Github发布" + name: "Github版本发布" runs-on: macos-latest - needs: - - install-init ## 主库master、next且执行release更新时执行 if: github.repository == '142vip/408CSFamily' && startsWith(github.event.head_commit.message, 'chore(release):') @@ -149,11 +100,6 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 - ## 支持思维导图转化 - - name: Build Mark-Map - run: | - ./scripts/mark-map - ### 打成压缩包 - name: Create Zip Package run: | diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4b07a60d..e2bf18cb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,22 +33,21 @@ jobs: # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 fetch-depth: 0 + ## 依赖下载完成后,或执行思维导图编译 - name: PNPM Install uses: pnpm/action-setup@v2 with: version: 7 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.18.0 - ## 淘宝镜像加速 - registry-url: 'https://registry.npmmirror.com' - cache: 'pnpm' - - - name: Install Dependencies - run: | - pnpm i --frozen-lockfile --registry https://registry.npmmirror.com + run_install: | + args: [--frozen-lockfile, --registry=https://registry.npmmirror.com] + + # - name: Install Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 18.18.0 + # ## 淘宝镜像加速 + # registry-url: 'https://registry.npmmirror.com' + # cache: 'pnpm' - name: Cache Dependencies uses: actions/cache@v3 diff --git a/.npmrc b/.npmrc index 0ed50958..a9a64485 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,4 @@ +## 参考:https://pnpm.io/zh/npmrc#prefer-frozen-lockfile ## 锁定版本 engine-strict = true shamefully-hoist=true