From 80db7b4d01aff6f9c7ea5221c4eafc8cf2dbeab8 Mon Sep 17 00:00:00 2001 From: PrasadAthani <150219751+PrasadAthani@users.noreply.github.com> Date: Sat, 20 Jul 2024 02:21:46 +0530 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 43 +++++++++++++------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab5a132..6c0fae4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,3 @@ - ##It is deploying on server 3.6.249.151 For Dev Environment only please note. name: Deploy to DEV on: push: @@ -40,39 +39,25 @@ jobs: cd /home/prasad/vihsal-api/api-test/ ./deploy.sh ENDSSH - + - name: Deploy to server + run: | + - variables: + EMAIL_RECIPIENTS: "prasad.athani@tekditechnologies.com" -variables: - EMAIL_RECIPIENTS: "prasad.athani@tekditechnologies.com" + - name: Deploy to server + run: | + - apt-get update -qy + - apt-get install -y python3-pip + - pip3 install sendmail -before_script: - - apt-get update -qy - - apt-get install -y python3-pip - - pip3 install sendmail - build: - stage: build - script: - - echo "Building the project..." - after_script: - - if [ "$CI_JOB_STATUS" == "success" ]; then echo "Build successful!" | sendmail $EMAIL_RECIPIENTS; fi - - if [ "$CI_JOB_STATUS" == "failed" ]; then echo "Build failed!" | sendmail $EMAIL_RECIPIENTS; fi + - name: Deploy to server + run: | + - if [ "$CI_JOB_STATUS" == "success" ]; then echo "Build successful!" | sendmail $EMAIL_RECIPIENTS; fi + - if [ "$CI_JOB_STATUS" == "failed" ]; then echo "Build failed!" | sendmail $EMAIL_RECIPIENTS; fi + -test: - stage: test - script: - - echo "Running tests..." - after_script: - - if [ "$CI_JOB_STATUS" == "success" ]; then echo "Tests successful!" | sendmail $EMAIL_RECIPIENTS; fi - - if [ "$CI_JOB_STATUS" == "failed" ]; then echo "Tests failed!" | sendmail $EMAIL_RECIPIENTS; fi -deploy: - stage: deploy - script: - - echo "Deploying the project..." - after_script: - - if [ "$CI_JOB_STATUS" == "success" ]; then echo "Deployment successful!" | sendmail $EMAIL_RECIPIENTS; fi - - if [ "$CI_JOB_STATUS" == "failed" ]; then echo "Deployment failed!" | sendmail $EMAIL_RECIPIENTS; fi