Skip to content

Commit

Permalink
feat: pnpm setup step (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Nov 22, 2023
1 parent 365f138 commit 7e93407
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/reusable-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ on:
type: string
default: ${{ github.event.pull_request.head.sha }}
version:
description: Next custom version (Not included prefix)
type: string
default: ''
description: Next custom version (Not included prefix)
type: string
default: ""
outputs:
version:
description: Next version
Expand Down Expand Up @@ -342,8 +342,24 @@ jobs:
# マージされていない時には github.event.pull_request.head.sha を使い、マージされた時にはgithub.base_refを使う
ref: ${{ inputs.is-merged == true && github.base_ref || inputs.pr-head-sha }}

- name: 📂 Check exists .node-version
id: check-node-version-file
run: |
if [ ! -f ".node-version" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
else
echo "exists=true" >> $GITHUB_OUTPUT
fi
- name: 🏗️ Setup node env
uses: actions/setup-node@v4
if: ${{ steps.check-node-version-file.outputs.exists == 'true' }}
with:
node-version-file: .node-version

- name: 🏗️ Setup node env
if: ${{ steps.check-node-version-file.outputs.exists == 'false' }}
uses: actions/setup-node@v2
with:
node-version: 18

Expand All @@ -358,13 +374,18 @@ jobs:
echo "package-manager=npm" >> "$GITHUB_OUTPUT"
fi
- name: Setup pnpm
uses: pnpm/action-setup@v2
if: ${{ steps.check-package-manager.outputs.package-manager == 'pnpm' }}
with:
run_install: false

- name: 📦 Install dependencies
run: |
if [ "${{ steps.check-package-manager.outputs.package-manager }}" == "yarn" ]; then
yarn
yarn install --frozen-lockfile
elif [ "${{ steps.check-package-manager.outputs.package-manager }}" == "pnpm" ]; then
pnpm install
pnpm install --frozen-lockfile --prefer-frozen-lockfile
else
npm install
fi
Expand Down

0 comments on commit 7e93407

Please sign in to comment.