Skip to content

Commit

Permalink
Update GitHub actions & use actions/setup-node
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
Marcono1234 committed May 8, 2024
1 parent b1ad0ea commit 96f581f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ jobs:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

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

- name: Install
run: npm i
run: npm clean-install

- name: Build
run: npm run build
Expand Down

0 comments on commit 96f581f

Please sign in to comment.