Skip to content

Create main.yml #1

Create main.yml

Create main.yml #1

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build the application
run: npm run build
- name: Run tests
run: npm test
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Deploy to production
run: |
# Your deployment script here
ssh user@host "cd /path/to/app && git pull origin main && npm run deploy"