Skip to content

Commit

Permalink
Update ci-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamji34 authored Sep 5, 2024
1 parent 8385891 commit d22162e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,15 @@ jobs:
run: |
echo "$SSH_KEY" | tr -d '\r' > hackathon.pem
chmod 600 hackathon.pem
ssh -o StrictHostKeyChecking=no -i hackathon.pem $USER@$BASTION_HOST << 'EOF'
ssh -o StrictHostKeyChecking=no -i hackathon.pem $USER@${{ secrets.EC2_HOST }} << 'INNER_EOF'
ssh -t -o StrictHostKeyChecking=no -i hackathon.pem $USER@$BASTION_HOST << 'EOF'
ssh -t -o StrictHostKeyChecking=no -i hackathon.pem $USER@${{ secrets.EC2_HOST }} << 'INNER_EOF'
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
docker pull ${{ secrets.IMAGE_NAME }}
if [ $(docker ps -a -q -f name= gratitude-container) ]; then
if [ $(docker ps -a -q -f name=gratitude-container) ]; then
docker stop gratitude-container || true
docker rm gratitude-container || true
fi
docker run -d --name gratitude-container -p 8080:8080 ${{ secrets.IMAGE_NAME }}
INNER_EOF
EOF
rm hackathon.pem

0 comments on commit d22162e

Please sign in to comment.