Skip to content

Commit

Permalink
Common install package action
Browse files Browse the repository at this point in the history
  • Loading branch information
wwahammy authored Aug 28, 2023
1 parent af5e043 commit 988f73d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .github/actions/install-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Install packages'
description: "Install packages"
inputs:
node:
description: "Which node version?"
ruby:
description: "Which ruby version?"
runs:
using: "composite"
steps:

- uses: actions/setup-node@v3
if: ${{ inputs.node != '' }}
with:
node-version: ${{ inputs.node }}
cache: 'yarn'

- run: yarn install --frozen-lockfile
if: ${{ inputs.node != '' }}
shell: sh

- uses: ruby/setup-ruby@v1
if: ${{ inputs.ruby != '' }}
with:
ruby-version: ${{ inputs.ruby }}
bundler-cache: true
6 changes: 2 additions & 4 deletions .github/workflows/npm-cache-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: ./.github/actions/install-packages
with:
node-version: ${{ inputs.node }}
cache: 'yarn'
- run: yarn install --frozen-lockfile
node: ${{ inputs.node }}

0 comments on commit 988f73d

Please sign in to comment.