Skip to content

Commit dd99202

Browse files
Update GitHub actions & use actions/setup-node (#231)
`actions/setup-node` makes sure that the specified Node.js version is used, and the workflow does not rely implicitly on the Node.js version provided by the runner image. Also uses `npm clean-install` to make sure the `package-lock.json` content matches what is specified in `package.json`, instead of updating it. Co-authored-by: Greymagic27 <46166848+Greymagic27@users.noreply.github.com>
1 parent 9eb5fee commit dd99202

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ jobs:
88
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
persist-credentials: false
1414

15-
- name: Cache Node Modules
16-
uses: actions/cache@v3
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
1717
with:
18-
path: ~/.npm
19-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20-
restore-keys: ${{ runner.os }}-node-
18+
node-version: 18
19+
cache: 'npm'
2120

2221
- name: Install
23-
run: npm i
22+
run: npm clean-install
2423

2524
- name: Build
2625
run: npm run build

0 commit comments

Comments
 (0)