Skip to content

Commit 914a1ac

Browse files
committed
Cache restored before installing dependencies
saving time in pipeline
1 parent f8faaa1 commit 914a1ac

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/ci-cd-pipeline.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ jobs:
3030
# echo "DB_CONN_STRING=${{ secrets.DB_CONN_STRING }}" >> .env
3131
# echo "DB_NAME=chatHavenDB" >> .env
3232
# echo "PORT=3000" >> .env
33-
34-
# Install backend dependencies
35-
- name: Install backend dependencies
36-
working-directory: ./backend
37-
run: npm install
3833

39-
# Install frontend dependencies
40-
- name: Install frontend dependencies
41-
working-directory: ./frontend
42-
run: npm install
43-
4434
# Prevents installing dependencies if package-lock.json hasn't changed
4535
- name: Cache Node.js dependencies
4636
uses: actions/cache@v2
4737
with:
4838
path: |
4939
~/.npm
50-
./node_modules
5140
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
5241
restore-keys: |
53-
${{ runner.os }}-node-
42+
${{ runner.os }}-node-
43+
44+
# Install backend dependencies
45+
- name: Install backend dependencies
46+
working-directory: ./backend
47+
run: npm ci
48+
49+
# Install frontend dependencies
50+
- name: Install frontend dependencies
51+
working-directory: ./frontend
52+
run: npm ci
53+
5454

5555
# # Run backend tests
5656

0 commit comments

Comments
 (0)