Skip to content

Commit

Permalink
Added node js workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-511 committed Oct 13, 2024
1 parent eda1fce commit 621d72a
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Deploy Twitter App

# Trigger the workflow on push or pull request to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main

# Define the jobs that will run
jobs:
build:

# Use the latest Ubuntu runner
runs-on: ubuntu-latest

# Define the steps in the build job
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Node.js (use the required Node version)
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # You can specify your Node.js version

# Step 3: Install dependencies for both backend and frontend
- name: Install dependencies
run: |
npm install
npm install --prefix frontend
# Step 4: Build the frontend (assuming your frontend build script is set)
- name: Build frontend
run: npm run build --prefix frontend

# Step 5: Run backend server (development)
- name: Start backend server
run: npm run dev

# Optional: Add a step to run tests (if you have test scripts)
# - name: Run tests
# run: npm test

0 comments on commit 621d72a

Please sign in to comment.