Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
AWS Deployment Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rorogab committed Dec 6, 2024
1 parent d9c53ed commit cf169e1
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions .github/workflows/CI-CD-Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,25 @@ jobs:
MAIL_PASS: ${{ secrets.MAIL_PASS }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/pawsome-front.pem ec2-user@${{ secrets.EC2_PUBLIC_IP }} << EOF
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/private_instance_key.pem ec2-user@${{ secrets.EC2_PRIVATE_IP }} << 'INNER_SSH'
cd /home/ec2-user || mkdir /home/ec2-user;
if [ ! -d /home/ec2-user/i004-pawsome-back ]; then
git clone https://github.com/igrowker/i004-pawsome-back /home/ec2-user/i004-pawsome-back;
fi;
cd /home/ec2-user/i004-pawsome-back;
git pull;
npm install;
export URI=${URI}
export PORT=${PORT}
export MAIL_HOST=${MAIL_HOST}
export MAIL_PORT=${MAIL_PORT}
export MAIL_USER=${MAIL_USER}
export MAIL_PASS=${MAIL_PASS}
export JWT_SECRET=${JWT_SECRET}
npm run build;
pm2 reload ecosystem.config.js || pm2 start ecosystem.config.js --env production;
INNER_SSH
ssh -o StrictHostKeyChecking=no -i ~/.ssh/pawsome-front.pem ec2-user@${{ secrets.EC2_PUBLIC_IP }} << 'EOF'
ssh -o StrictHostKeyChecking=no -i /private_instance_key.pem ec2-user@${{ secrets.EC2_PRIVATE_IP }} << 'INNER_SSH'
cd /home/ec2-user
if [ ! -d "i004-devops" ]; then
git clone https://github.com/igrowker/i004-devops.git
fi
cd i004-devops/pawsome/Pawsome
docker-compose pull
export MONGODB_URI=${MONGODB_URI}
export PORT=${PORT}
export MAIL_HOST=${MAIL_HOST}
export MAIL_PORT=${MAIL_PORT}
export MAIL_USER=${MAIL_USER}
export MAIL_PASS=${MAIL_PASS}
export JWT_SECRET=${JWT_SECRET}
docker-compose up -d --build
INNER_SSH
EOF

0 comments on commit cf169e1

Please sign in to comment.