Skip to content

Commit 0bfc335

Browse files
committed
chore: update deployment workflow to use actions/setup-node@v3 and enhance caching strategy
- Upgraded Node.js setup action to v3 for improved performance and features. - Enhanced caching strategy for Playwright browsers and npm to optimize installation efficiency. - Added verification step for npm cache to ensure integrity before installation.
1 parent d9d4e78 commit 0bfc335

1 file changed

Lines changed: 33 additions & 21 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,23 @@ jobs:
2222
runs-on: ${{ matrix.os }}
2323
steps:
2424
- uses: actions/checkout@v2
25-
- uses: actions/setup-node@v1
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v3
2627
with:
27-
node-version: 18
28-
- uses: actions/cache@v3
28+
node-version: '18'
29+
cache: 'npm'
30+
- name: Cache Playwright browsers
31+
uses: actions/cache@v3
32+
id: playwright-cache
2933
with:
3034
path: |
31-
~/.npm
35+
~/.cache/ms-playwright
3236
node_modules/.cache/ms-playwright
33-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-playwright-1.40.1
37+
key: ${{ runner.os }}-playwright-1.40.1
3438
restore-keys: |
35-
${{ runner.os }}-node-
39+
${{ runner.os }}-playwright-
40+
- name: Verify npm cache
41+
run: npm cache verify || npm cache clean --force
3642
- name: Install dependencies
3743
run: npm ci
3844
- name: Install Playwright browsers
@@ -48,17 +54,24 @@ jobs:
4854
runs-on: ${{ matrix.os }}
4955
steps:
5056
- uses: actions/checkout@v2
51-
- uses: actions/setup-node@v1
57+
- name: Setup Node.js
58+
uses: actions/setup-node@v3
5259
with:
53-
node-version: 18
54-
- uses: actions/cache@v3
60+
node-version: '18'
61+
cache: 'npm'
62+
- name: Cache Playwright browsers
63+
uses: actions/cache@v3
64+
id: playwright-cache
5565
with:
5666
path: |
57-
~/.npm
67+
~/.cache/ms-playwright
5868
node_modules/.cache/ms-playwright
59-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-playwright-1.40.1
69+
key: ${{ runner.os }}-playwright-1.40.1
6070
restore-keys: |
61-
${{ runner.os }}-node-
71+
${{ runner.os }}-playwright-
72+
- name: Verify npm cache
73+
run: npm cache verify || npm cache clean --force
74+
shell: pwsh
6275
- name: Install dependencies
6376
run: npm ci
6477
shell: pwsh
@@ -78,17 +91,16 @@ jobs:
7891
uses: actions/checkout@v2
7992
with:
8093
fetch-depth: 0
81-
- uses: actions/setup-node@v2
94+
- name: Setup Node.js
95+
uses: actions/setup-node@v3
8296
with:
83-
node-version: '18.x'
97+
node-version: '18'
98+
cache: 'npm'
8499
registry-url: 'https://registry.npmjs.org'
85-
- uses: actions/cache@v3
86-
with:
87-
path: ~/.npm
88-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
89-
restore-keys: |
90-
${{ runner.os }}-node-
91-
- run: npm install --no-audit --registry https://registry.npmjs.org/ --no-shrinkwrap
100+
- name: Verify npm cache
101+
run: npm cache verify || npm cache clean --force
102+
- name: Install dependencies
103+
run: npm ci
92104
- name: Read version from package.json
93105
uses: culshaw/read-package-node-version-actions@v1
94106
id: package-node-version

0 commit comments

Comments
 (0)