chore(ci): cache node_modules

This commit is contained in:
Daniel Sogl 2021-08-22 23:44:26 +02:00 committed by GitHub
parent 86350cea97
commit b9731d4abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,6 @@ on: [push]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@ -12,35 +11,46 @@ jobs:
node-version: [14.x] node-version: [14.x]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Cache ionic site # - name: Cache ionic site
id: ionic-site # id: ionic-site
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ~/ionic-site/ # path: ~/ionic-site/
key: ionic-site-${{ hashFiles('**/package-lock.json') }} # key: ionic-site-${{ hashFiles('**/package-lock.json') }}
- name: Setup git - name: Cache node modules
run: bash ./scripts/git/config.sh uses: actions/cache@v2
- name: Prepare ionic-site repo env:
if: github.ref == 'refs/heads/master' cache-name: cache-node-modules
run: bash ./scripts/docs/prepare.sh with:
- name: Install dependencies path: ~/.npm
run: npm ci key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Lint restore-keys: |
run: npm run lint ${{ runner.os }}-build-${{ env.cache-name }}-
- name: Build ${{ runner.os }}-build-
run: npm run build ${{ runner.os }}-
- name: Test - name: Setup git
run: npm run test run: bash ./scripts/git/config.sh
- name: Readmes - name: Prepare ionic-site repo
run: npm run readmes if: github.ref == 'refs/heads/master'
- name: Deploy doc run: bash ./scripts/docs/prepare.sh
if: github.ref == 'refs/heads/master' - name: Install dependencies
run: bash ./scripts/docs/update_docs.sh run: npm ci
env: - name: Lint
GITHUB_PROJECT_REPONAME: ${{ github.repository }} run: npm run lint
GITHUB_SHA1: ${{ github.sha }} - name: Build
run: npm run build
- name: Test
run: npm run test
- name: Readmes
run: npm run readmes
# - name: Deploy doc
# if: github.ref == 'refs/heads/master'
# run: bash ./scripts/docs/update_docs.sh
# env:
# GITHUB_PROJECT_REPONAME: ${{ github.repository }}
# GITHUB_SHA1: ${{ github.sha }}