Change to pull always #8
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 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 |