Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
PrasadAthani authored Jul 19, 2024
1 parent fbee280 commit 80db7b4
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -40,39 +39,25 @@ jobs:
cd /home/prasad/vihsal-api/api-test/
./deploy.sh
ENDSSH
- name: Deploy to server
run: |
- variables:
EMAIL_RECIPIENTS: "[email protected]"
variables:
EMAIL_RECIPIENTS: "[email protected]"
- 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

0 comments on commit 80db7b4

Please sign in to comment.