Skip to content

Commit

Permalink
Merge pull request #7 from Code-the-Dream-School/Hermann27-patch-1
Browse files Browse the repository at this point in the history
Create main.yml to check npm install and start
  • Loading branch information
Hermann27 authored Nov 25, 2024
2 parents 6fb1369 + 718dbef commit 1198899
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node.js CI

on:
push:
branches:
- main # Branche to trigger the workflow
pull_request:
branches:
- main # Branche to trigger the workflow

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v3

# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22.2.0'

# Install dependencies
- name: Install dependencies
run: npm install

# Check that npm run dev works (i.e., the app runs correctly)
- name: Start the application
run: npm run dev &
continue-on-error: false # true Allow the workflow to continue even if npm start fails

# Wait for the app to be ready (adjust as needed)
- name: Wait for app to start
run: sleep 10 # Optional: Adjust sleep duration based on your app's startup time

# Check if the process is running (this checks if npm run dev worked)
- name: Verify the app is running
run: |
if ! pgrep -f "npm run dev" > /dev/null; then
echo "npm run dev did not run correctly" && exit 1
fi

0 comments on commit 1198899

Please sign in to comment.