ci: upgrade to actions/cache@v2 actions/setup-node@v2

This commit is contained in:
Haishan 2020-11-13 23:33:14 +08:00
parent 3bbca8017b
commit d0be66d696
2 changed files with 16 additions and 14 deletions

View file

@ -11,25 +11,27 @@ jobs:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
${{ runner.os }}-yarn-
- name: Install Lint Build
run: |
yarn
yarn lint
yarn build
- name: Install
run: yarn
- name: Lint
run: yarn lint
- name: Build
run: yarn build
##### gh-pages
- name: Push to gh-pages

View file

@ -5,7 +5,7 @@
"scripts": {
"lint": "eslint --fix --cache src",
"start": "NODE_ENV=development node server.js",
"build": "NODE_ENV=production webpack --progress",
"build": "NODE_ENV=production webpack",
"pretty": "prettier --single-quote --write 'src/**/*.{js,scss,ts,tsx,md}'"
},
"browserslist": [