Clean: CI - Setup action separated

This commit is contained in:
alstjr7375 2023-01-11 09:49:42 +09:00
parent 47bb1e49fe
commit 64c453b505
3 changed files with 34 additions and 17 deletions

29
.github/actions/node-setup/action.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: "Setup"
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Node cache
id: node-cache
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
"**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }
${{ runner.os }}-node-
- name: Package Install
if: steps.node-cache.outputs.cache-hit != 'true'
run: yarn install
shell: bash