Skip to content

Commit 827c2a3

Browse files
DangDang
authored andcommitted
fix: Resolve GitHub Actions npm cache issue
- Replace setup-node cache with manual cache action - Use actions/cache@v3 for better npm dependency caching - Fix cache path resolution issues - Improve CI/CD reliability and performance Fixes: ✅ npm cache path resolution error ✅ Better dependency caching strategy ✅ More reliable CI/CD workflows
1 parent 782806a commit 827c2a3

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.github/workflows/frontend-ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: '18'
26-
cache: 'npm'
27-
cache-dependency-path: VehicleShowroom/package-lock.json
26+
27+
- name: Cache npm dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: VehicleShowroom/node_modules
31+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-npm-
2834
2935
- name: Install dependencies
3036
working-directory: ./VehicleShowroom
@@ -50,8 +56,14 @@ jobs:
5056
uses: actions/setup-node@v4
5157
with:
5258
node-version: '18'
53-
cache: 'npm'
54-
cache-dependency-path: VehicleShowroom/package-lock.json
59+
60+
- name: Cache npm dependencies
61+
uses: actions/cache@v3
62+
with:
63+
path: VehicleShowroom/node_modules
64+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
65+
restore-keys: |
66+
${{ runner.os }}-npm-
5567
5668
- name: Install dependencies
5769
working-directory: ./VehicleShowroom
@@ -93,4 +105,4 @@ jobs:
93105
service-id: ${{ secrets.RENDER_SERVICE_ID }}
94106
api-key: ${{ secrets.RENDER_API_KEY }}
95107
build-command: echo "Using pre-built artifacts"
96-
publish-directory: VehicleShowroom/build
108+
publish-directory: VehicleShowroom/build

.github/workflows/fullstack-ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ jobs:
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: '18'
21-
cache: 'npm'
22-
cache-dependency-path: VehicleShowroom/package-lock.json
21+
22+
- name: Cache npm dependencies
23+
uses: actions/cache@v3
24+
with:
25+
path: VehicleShowroom/node_modules
26+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-npm-
2329
2430
- name: Install frontend dependencies
2531
working-directory: ./VehicleShowroom
@@ -80,4 +86,4 @@ jobs:
8086
echo " 1. Go to render.com"
8187
echo " 2. Use Blueprint deployment with render.yaml"
8288
echo " 3. Set environment variables"
83-
echo " 4. Deploy both services"
89+
echo " 4. Deploy both services"

0 commit comments

Comments
 (0)