From eac56105c1ad68be5bf87de68266f365a7d7452a Mon Sep 17 00:00:00 2001 From: Zoey Date: Mon, 19 Aug 2024 11:08:53 +0200 Subject: [PATCH] fix: update nodejs versions in CI pipeline (#191) --- .github/workflows/ci.yaml | 39 +++++++++++++++++++----------- .github/workflows/deploy-docs.yaml | 21 +++++++++++----- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 493d26a..1397734 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,39 +6,50 @@ on: pull_request: branches: [ main ] +env: + NODE_VER: 22.5 + jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 20.6.1 - uses: actions/setup-node@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm with: - node-version: 20.6.1 + run_install: false - - name: Setup - run: npm i -g @antfu/ni + - name: Use Node.js ${{ env.NODE_VER }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VER }} + cache: 'pnpm' - name: Install - run: nci + run: pnpm i - name: Lint - run: nr lint + run: pnpm lint build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 20.6.1 - uses: actions/setup-node@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm with: - node-version: 20.6.1 + run_install: false - - name: Setup - run: npm i -g @antfu/ni + - name: Use Node.js ${{ env.NODE_VER }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VER }} + cache: 'pnpm' - name: Install - run: nci + run: pnpm i - name: Build - run: nr build + run: pnpm build diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 6987b42..10af5e0 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -7,6 +7,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + NODE_VER: 22.5 + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -28,21 +31,27 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Required to calculate lastUpdated - - name: Install pnpm - uses: pnpm/action-setup@v3 + + - uses: pnpm/action-setup@v4 + name: Install pnpm with: - version: 8 - - name: Setup Node + run_install: false + + - name: Use Node.js ${{ env.NODE_VER }} uses: actions/setup-node@v4 with: - node-version: 20 - cache: pnpm + node-version: ${{ env.NODE_VER }} + cache: 'pnpm' + - name: Setup Pages uses: actions/configure-pages@v4 + - name: Install dependencies run: pnpm i + - name: Build with VitePress run: pnpm build + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: