Skip to content

Node.js CI

Node.js CI #211

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '30 5 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: techlauncher-mlai-edge-physics/physics_in_the_browser
path: ./main
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: main/package-lock.json
- run: npm ci --force
working-directory: ./main
- run: npm run build --if-present
working-directory: ./main
- run: touch ./main/dist/.nojekyll
- run: cp -r ./main/dist ./
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
# The folder in your repository that you want to deploy. If your build script compiles into a directory named build you would put it here. Folder paths cannot have a leading / or ./. If you wish to deploy the root directory you can place a . here.
folder: ./dist
# If you would like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here.