From 8d4f516646d0ad1314389a7fa70822a92b70d8b5 Mon Sep 17 00:00:00 2001 From: Obi Fortune Date: Sat, 20 Jul 2024 12:10:53 -0400 Subject: [PATCH 1/2] use pnpm in deploy scripts --- .github/workflows/dev-cicd.yml | 20 +++++++++++--------- .github/workflows/prod-cicd.yml | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dev-cicd.yml b/.github/workflows/dev-cicd.yml index aa75d6d2..f2e2fc9c 100644 --- a/.github/workflows/dev-cicd.yml +++ b/.github/workflows/dev-cicd.yml @@ -24,25 +24,27 @@ jobs: with: node-version: '20' - - name: Cache npm modules + - name: Cache pnpm modules uses: actions/cache@v3 with: - path: ~/.npm - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-npm- + ${{ runner.os }}-pnpm- - - name: Install npm - run: npm install -g npm@9 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 - name: Install dependencies - run: npm install + run: pnpm install - name: Lint code - run: npm run lint + run: pnpm lint - name: Build project - run: npm run build + run: pnpm build deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/prod-cicd.yml b/.github/workflows/prod-cicd.yml index 64dd3d30..291e8cbd 100644 --- a/.github/workflows/prod-cicd.yml +++ b/.github/workflows/prod-cicd.yml @@ -1,4 +1,3 @@ - name: Production CI/CD Pipeline on: @@ -25,25 +24,27 @@ jobs: with: node-version: '20' - - name: Cache npm modules + - name: Cache pnpm modules uses: actions/cache@v3 with: - path: ~/.npm - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-npm- + ${{ runner.os }}-pnpm- - - name: Install npm - run: npm install -g npm@9 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 - name: Install dependencies - run: npm install + run: pnpm install - name: Lint code - run: npm run lint + run: pnpm run lint - name: Build project - run: npm run build + run: pnpm run build deploy: runs-on: ubuntu-latest From 1bfdfc8d29b0ee35fecf2330b596091aeb0acbfe Mon Sep 17 00:00:00 2001 From: Obi Fortune Date: Sat, 20 Jul 2024 12:14:32 -0400 Subject: [PATCH 2/2] use pnpm in staging deploy scripts --- .github/workflows/staging-cicd.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/staging-cicd.yml b/.github/workflows/staging-cicd.yml index d0bf5f56..2bbb9b80 100644 --- a/.github/workflows/staging-cicd.yml +++ b/.github/workflows/staging-cicd.yml @@ -24,25 +24,27 @@ jobs: with: node-version: '20' - - name: Cache npm modules + - name: Cache pnpm modules uses: actions/cache@v3 with: - path: ~/.npm - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-npm- + ${{ runner.os }}-pnpm- - - name: Install npm - run: npm install -g npm@9 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 - name: Install dependencies - run: npm install + run: pnpm install - name: Lint code - run: npm run lint + run: pnpm run lint - name: Build project - run: npm run build + run: pnpm run build deploy: runs-on: ubuntu-latest