Update #2
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: NodeJS with Webpack | |
on: | |
push: | |
branches: [main] # Simplified syntax for single-item arrays | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 # Check out the latest code from the repository | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' # This option automatically caches npm dependencies and replaces the separate cache step | |
- name: Install dependencies | |
run: npm install # Install all project dependencies | |
- name: Build the project with Webpack | |
run: npx webpack # Run webpack using npx to bundle the application | |
# Moving Forward: Add steps for additional commands, such as testing or deployment |