mirror of
https://github.com/apotdevin/thunderhub.git
synced 2024-11-19 01:40:03 +01:00
ci: add caching
This commit is contained in:
parent
ab72b1607f
commit
4b99ccfc8e
26
.github/workflows/nodejs.yml
vendored
26
.github/workflows/nodejs.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Build
|
||||
name: Test, lint and build
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -14,6 +14,24 @@ jobs:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
id: cache-npm
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
|
||||
name: List the state of node modules
|
||||
continue-on-error: true
|
||||
run: npm list
|
||||
|
||||
- name: Install modules
|
||||
run: npm ci
|
||||
|
||||
@ -23,6 +41,10 @@ jobs:
|
||||
- name: Run tests
|
||||
run: npm run test
|
||||
|
||||
- name: Setup Docker Buildx Driver
|
||||
id: docker_driver_setup
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Run docker build
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
@ -30,3 +52,5 @@ jobs:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
Loading…
Reference in New Issue
Block a user