Merge pull request #918 from DalgoT4D/add-dbtcloud-run-dbttask #93
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: DDP backend deployment | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create known_hosts file | |
run: | | |
mkdir -p ~/.ssh | |
touch ~/.ssh/known_hosts | |
- name: Add remote host key to known_hosts | |
run: ssh-keyscan ${{ secrets.SERVERIP }} >> ~/.ssh/known_hosts | |
- name: Deploy to EC2 | |
run: | | |
eval `ssh-agent -s` | |
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | |
ssh ${{ secrets.SERVER }} " | |
source ~/.nvm/nvm.sh; | |
cd /home/ddp/DDP_backend; | |
git pull; | |
venv/bin/python manage.py migrate; | |
/home/ddp/.yarn/bin/pm2 restart django-celery-worker django-backend" |