diff --git a/.github/actions/node-setup/action.yml b/.github/actions/node-setup/action.yml new file mode 100644 index 0000000..f2dd690 --- /dev/null +++ b/.github/actions/node-setup/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06d708a..d1c5ed8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,21 +20,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Node cache - id: node-cache - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Package Install - if: steps.node-cache.outputs.cache-hit != 'true' - run: yarn install + - name: Setup + uses: ./.github/actions/node-setup - name: Build run: yarn build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9788e49..4f637e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,8 @@ jobs: sync-branches: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + fetch-depth: 0 - name: Merge master -> photon-style uses: devmasx/merge-branch@1.4.0 @@ -38,7 +39,7 @@ jobs: - name: "Lepton-Proton-Style" branch: "proton-style" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ matrix.branch }}