-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Caching Action for Dependencies and Update Workflow
- Loading branch information
1 parent
f6dfb72
commit d2fcc18
Showing
3 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Get & Cache Dependencies" | ||
description: "Get the dependencies (via npm) and cache them for later use." | ||
inputs: | ||
caching: | ||
description: "Whether to cache the dependencies or not." | ||
required: false | ||
default: "true" | ||
outputs: | ||
used-cache: | ||
description: "Whether the cache was used or not." | ||
value: ${{ steps.install.outputs.cache }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
if: inputs.caching == 'true' | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Install dependencies | ||
id: install | ||
if: steps.cache.outputs.cache-hit != 'true' || inputs.caching != 'true' | ||
shell: bash | ||
run: | | ||
npm ci | ||
echo "cache='${{ inputs.caching }}'" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters