Skip to content

Commit

Permalink
add node_pnpm_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Nov 12, 2024
1 parent 44ebb4d commit 09eda12
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/actions/node_pnpm_cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: node_pnpm_cache
description: Composite action to setup Node with pnpm and cache node_modules

inputs:
cache-paths:
description: paths to cache
required: false
cache-key:
description: cache key
required: true

outputs:
cache-hit:
description: forward the actions/cache cache-hit output
value: ${{ steps.node-cache.outputs.cache-hit }}

runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
**/node_modules
${{ inputs.cache-paths }}
key: ${{ inputs.cache-key }}
- uses: pnpm/action-setup@v3
with:
version: 8
2 changes: 1 addition & 1 deletion .github/workflows/deploy_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- id: cache-app
uses: ./.github/actions/setup-node-pnpm-cache
uses: ./.github/actions/node_pnpm_cache
with:
cache-key: app-${{ hashFiles('**/pnpm-lock.yaml') }}
cache-paths: |
Expand Down

0 comments on commit 09eda12

Please sign in to comment.