Skip to content

buildbuildbuild

buildbuildbuild #32

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 Build and Test CI
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: react-vite
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: react-vite/package-lock.json
- name: Clean install dependencies
run: |
rm -rf node_modules
npm install
- name: Run Build
run: npm run build:ci --if-present
- name: Commit and push changes
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add -A
git commit -m "update build files" || echo "No changes to commit"
git remote set-url origin https://${{ secrets.MY_GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push
- name: Run Tests
run: npm test --if-present