32 raspberry pi testing (#33) #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Client | |
on: | |
push: | |
# trigger on pull requests | |
pull_request: | |
branches: | |
- main | |
path: | |
- .github/workflows/client.yml | |
- client/** | |
# only trigger build for specific paths | |
paths: | |
- .github/workflows/client.yml | |
- client/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout repo so workspace can access it | |
- uses: actions/checkout@v4 | |
# set up node | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.16.0 | |
# caching node modules to prevent installing each time | |
# checks if package-lock.json has changed before running npm ci | |
- name: Cache Dependencies | |
id: cache | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: client/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('client/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# install dep. if cache miss | |
- name: Install Dependencies | |
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
working-directory: ./client | |
run: npm ci | |
- name: List Node Modules | |
working-directory: ./client | |
run: npm list | |
- name: Build Client | |
working-directory: ./client | |
run: npm run build | |