Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying node version #42

Closed
jerivas opened this issue Aug 14, 2020 · 4 comments
Closed

Allow specifying node version #42

jerivas opened this issue Aug 14, 2020 · 4 comments
Labels

Comments

@jerivas
Copy link

jerivas commented Aug 14, 2020

It looks like this action always uses node 12. Could you add a setting to choose another node version?

@leomelzer
Copy link

I wondered about the same and briefly dug into the topic. This is the relevant upstream issue: actions/runner#772

The GitHub Action runner is currently "stuck" on node12. I assume this is going to change in the coming months as node12 will end its LTS phase end of April next year.

@YenHub
Copy link
Contributor

YenHub commented Jun 19, 2021

Checkout my action setup here:- QuickList Deploy Action

You can simply set the node version like so:-

on:
  push:
    branches:
      - master
    paths:
      - 'client/**'

name:                       🧪 Auto | Deploy
jobs:
  web-deploy:
    name:                   🎉 Deploy
    runs-on:                ubuntu-latest
    steps:
    - name:                 🚚 Get latest code
      uses:                 actions/checkout@v2.3.2

    - name:                 🐱‍👤 Use Node.js 14.16.1
      uses:                 actions/setup-node@v2-beta
      with:
        node-version:       '14.16.1'

    - name:                 💥 Install & Cache Deps
      uses:                 bahmutov/npm-install@v1.4.5
      with:
        working-directory:  client

    - name:                 🔨 Build Project
      run:                  INLINE_RUNTIME_CHUNK=false npm run build
      working-directory:    client

@bbugh
Copy link

bbugh commented Dec 2, 2021

If you want to use .tool-versions like from asdf, you can do this:

      - name: Get Node.js version from .tool-versions
        id: node_setup
        run: echo ::set-output name=NODE_VERSION::$(cat .tool-versions | grep "nodejs" | grep -E -o "[0-9.]+")

      - name: Use Node.js ${{ steps.node_setup.outputs.NODE_VERSION }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ steps.node_setup.outputs.NODE_VERSION }}

      - uses: bahmutov/npm-install@v1

@github-actions
Copy link

🎉 This issue has been resolved in version 1.8.16 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants