Skip to content
package

GitHub Action

Setup Yarn and Node.js Action

v1 Latest version

Setup Yarn and Node.js Action

package

Setup Yarn and Node.js Action

Setup yarn cache and install dependencies

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Yarn and Node.js Action

uses: digi-fry/setup-yarn-node-action@v1

Learn more about this action in digi-fry/setup-yarn-node-action

Choose a version

Setup Yarn and Node.js Action

This GitHub Action sets up a specific version of Node.js and Yarn, installs dependencies, and sets up a cache for Yarn.

Usage

- uses: digi-fry/setup-yarn-node-action@v1
  with:
    node-version: '20'

Inputs

  • node-version: (Required) The version of Node.js to use. This should be a valid Node.js version.

Outputs

None

Example

name: My Workflow CI

on:
  push:
    branches:
      - main
  pull_request:
    types:
      - opened
      - reopened
      - synchronize

env:
  NODE_VERSION: 20

jobs:
  cache-and-install:
    runs-on: ubuntu-latest

    name: Setup Cache and Install Dependencies

    steps:
      - name: Setup Cache and Install Dependencies
        uses: digi-fry/setup-yarn-node-action@v1
        with:
          node-version: ${{ env.NODE_VERSION }}

License

MIT