Skip to content

fix: remove build app #29

fix: remove build app

fix: remove build app #29

Workflow file for this run

name: Deploy to DigitalOcean
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH and known hosts
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add DigitalOcean droplet to known_hosts
run: ssh-keyscan ${{ secrets.DROPLET_IP }} >> ~/.ssh/known_hosts
- name: Copy project files to the server
run: rsync -avz --exclude '/node_modules/' --exclude '/.git/' ./ root@${{ secrets.DROPLET_IP }}:/root/abibliadigital/
- name: Environment setup
run: |
ssh root@${{ secrets.DROPLET_IP }} "echo 'MONGODB_URI=${{ secrets.MONGODB_URI }}' >> /root/abibliadigital/.env"
ssh root@${{ secrets.DROPLET_IP }} "echo 'SECRET_KEY=${{ secrets.SECRET_KEY }}' >> /root/abibliadigital/.env"
ssh root@${{ secrets.DROPLET_IP }} "echo 'SENDGRID_KEY=${{ secrets.SENDGRID_KEY }}' >> /root/abibliadigital/.env"
ssh root@${{ secrets.DROPLET_IP }} "echo 'REDIS_URL=${{ secrets.REDIS_URL }}' >> /root/abibliadigital/.env"
- name: Restart the application
run: ssh root@${{ secrets.DROPLET_IP }} "cd /root/abibliadigital/ && docker-compose down && docker-compose up -d"