Skip to content

Change to pull always #8

Change to pull always

Change to pull always #8

name: Deploy to staging EC2
on:
push:
branches:
- staging
pull_request:
branches:
- staging
types: [opened, synchronize, reopened]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.STAGING_EC2_SSH_PRIVATE_KEY }}
- name: SSH and Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no [email protected] << 'EOF'
docker kill $(docker ps -q)
docker system prune -af
cd /home/ec2-user/danswer
git fetch origin staging
git reset --hard FETCH_HEAD
cd /home/ec2-user/danswer/deployment/docker_compose
source .env
docker-compose -p danswer-stack -f docker-compose.prod.yml up -d --pull always --force-recreate
EOF