Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Dev CI/CD

on:
push:
branches: [ dev ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Build
run: npm run build || echo "No build script"

- name: Send email if fails
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.EMAIL_USER }}
password: ${{ secrets.EMAIL_PASS }}
subject: "DEV Workflow Failed"
body: "Dev workflow for StudyHubDigitalLibrary failed"
to: kailasrpillai2074@gmail.com
from: GitHub Actions

65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
pipeline {
agent any

options {
buildDiscarder(logRotator(numToKeepStr: '20'))
timestamps()
}

tools {
nodejs 'node18'
}

stages {
stage('Checkout') {
steps {
checkout scm
echo 'Listing files after checkout:'
sh 'ls -la'
}
}

stage('Install Dependencies') {
steps {
sh 'npm install --cache .npm-cache'
}
}

stage('Build') {
steps {
echo 'Building DEV branch'
sh 'npm run build:dev || true'
}
}

stage('Test') {
steps {
sh 'npm test || true'
}
}

stage('Deploy') {
steps {
echo 'Deploying to DEV environment'
}
}
}

post {
success {
emailext(
to: 'kailasrpillai2074@gmail.com',
subject: "DEV Build SUCCESS: ${env.JOB_NAME} [${env.BUILD_NUMBER}]",
body: "DEV Build succeeded! Check details at ${env.BUILD_URL}"
)
}

failure {
emailext(
to: 'kailasrpillai2074@gmail.com',
subject: "DEV Build FAILED: ${env.JOB_NAME} [${env.BUILD_NUMBER}]",
body: "DEV Build failed! Check console output at ${env.BUILD_URL}"
)
}
}
}
3 changes: 3 additions & 0 deletions __test__/server.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('dummy test', () => {
expect(true).toBe(true);
});
Loading