Skip to content

Commit

Permalink
GH Actions: move dependencies caching into custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihor Khomiak committed Jun 3, 2024
1 parent 5ba475a commit 3141f09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/actions/cached-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ runs:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
shell: bash
22 changes: 4 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ jobs:
- name: Get code
uses: actions/checkout@v3

- name: "Cache dependencies"
id: cache
uses: "actions/cache@v3"
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Load & cache dependencies
uses: ./.github/actions/cached-deps

- name: Run linters
run: |
Expand All @@ -48,15 +41,8 @@ jobs:
- name: Get code
uses: actions/checkout@v3

- name: "Cache dependencies"
id: cache
uses: "actions/cache@v3"
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Load & cache dependencies
uses: ./.github/actions/cached-deps

- name: Build project
run: npm run build
Expand Down

0 comments on commit 3141f09

Please sign in to comment.