diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..2858056c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: CI/CD Pipeline + +# Trigger the workflow on push and pull request events +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Deploy to Production + run: | + # Add your deployment script/commands here + echo "Deploying to production..." + # Example: + # npm run deploy diff --git a/README.md b/README.md index 0da6c134..22f26265 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,5 @@ In package.json add below entry, npm login --registry=NexusRepoURL -Execute below command to upload packages to nexus repo. - -npm publish diff --git a/package.json b/package.json index 12763253..57815c44 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "This Project explains all Node JS examples", "main": "app.js", "publishConfig": { - "registry": "http://3.236.129.45:8081/repository/ebay-npm-repo/" + "registry": "http://34.238.125.146:8081/repository/ebay-npm/" }, "scripts": { "server": "http-server -c-1 -p 9999", diff --git a/sonar-project.js b/sonar-project.js index ecc84993..2fa6c54f 100644 --- a/sonar-project.js +++ b/sonar-project.js @@ -1,12 +1,12 @@ const sonarqubeScanner = require('sonarqube-scanner'); sonarqubeScanner({ - serverUrl: 'http://3.236.129.45:9000/', + serverUrl: 'http://54.161.163.175:9000/', options : { 'sonar.projectDescription': 'This is a Node JS application', 'sonar.projectName': 'Node JS Application - Sample', 'sonar.projectKey':'NodeJsLandmarkTechnologies', - 'sonar.login': '3e9ee4f64a40359b3f9c904bc34392412e2c9d80', + 'sonar.login': 'ef43528407d3494ed8beb4cd6283695552e2c349', //'sonar.password': 'admin', 'sonar.projectVersion':'1.0', 'sonar.language':'js',