Merge pull request #2 from DataCody/dev #2
This file contains hidden or 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 PostgreSQL to EC2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| postgres: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup SSH | |
| uses: webfactory/ssh-agent@v0.8.2 | |
| with: | |
| ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | |
| - name: Sync project to EC2 | |
| run: | | |
| rsync -avz -e "ssh -o StrictHostKeyChecking=no" \ | |
| ./ ec2-user@3.107.181.27:~/bigstar-data-migration/ | |
| - name: Deploy Docker Compose | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ec2-user@3.107.181.27 << 'EOF' | |
| cd ~/bigstar-data-migration/ | |
| docker-compose pull | |
| docker-compose up -d | |
| EOF |