Typo corrected to production #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy on Production Update | |
on: | |
push: | |
branches: | |
- prod | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.PROD_SSH_KEY }} | |
- name: Deploy to Production | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.PROD_EC2_USER }}@${{ secrets.PROD_EC2_HOST_IP }} << 'EOF' | |
cd danswer | |
make re-deploy | |
echo "Deployment complete" | |
EOF | |
- name: Wait before pinging | |
run: sleep 60 | |
- name: Ping the website | |
run: | | |
response=$(curl -o /dev/null -s -w "%{http_code}\n" https://hubgpt-prod.idinsight.io) | |
if [ "$response" -eq 200 ]; then | |
echo "Site is up and returned HTTP status 200" | |
else | |
echo "Site might be down or is not returning HTTP status 200, returned HTTP status $response" | |
exit 1 | |
fi |