Skip to content

Commit

Permalink
test: github action cache node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hq001 committed Dec 19, 2020
1 parent b86f588 commit d2acaa3
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,61 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: install
run: yarn install

- name: install lerna
run: yarn bootstrap


cypress-run:
name: Cypress run
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

- uses: cypress-io/github-action@v2
with:
config-file: cypress.json
start: yarn dev
wait-on: http://localhost:8080
wait-on-timeout: 60


build:
name: Yarn build
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 12

- name: Load node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: install dependencies
run: yarn install --prefer-offline

- name: lint
run: yarn lint

- name: build
run: yarn build

- name: run deploy.sh
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand Down

0 comments on commit d2acaa3

Please sign in to comment.