Merge pull request #54 from smithjac/finalCleanup #44
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: | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy: | |
name: Deploy to EC2 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: SSH into EC2 Instance | |
env: | |
HOSTNAME: ${{ secrets.TEST_EC2_PUBLIC_IP }} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: | | |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | |
ssh -T -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} << EOF | |
cd /home/ec2-user/Mirrulations_Search | |
docker-compose down | |
docker system prune -a -f | |
git pull | |
docker-compose build | |
docker-compose up -d | |
EOF |