Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
add setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jun 4, 2024
1 parent 0510844 commit 020874d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Install Project"
description: "Installs node, npm, and dependencies"
inputs:
node-version:
description: "Node.js version"
required: true
default: "20"
npm-version:
description: "npm version"
required: true
default: "8"
runs:
using: "composite"
steps:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: "https://registry.npmjs.org"
- name: Install npm
shell: bash
run: npm install -g npm@${{ inputs.npm-version }}
- name: Cache Dependencies
id: node-modules-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
shell: bash
run: npm ci

0 comments on commit 020874d

Please sign in to comment.