add echo secret_key #18
Workflow file for this run
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 DigitalOcean | |
on: | |
push: | |
branches: | |
- config/digital-ocean | |
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: Copy project files to the server | |
run: | | |
echo 'MONGODB_URI=${{ secrets.SECRET_KEY }} | |
rsync -avz --exclude '/node_modules/' --exclude '/.git/' ./ ${{ secrets.DROPLET_IP }}:/root/abibliadigital/ | |
- name: Build container | |
run: ssh ${{ secrets.DROPLET_IP }} "cd /root/abibliadigital/ && docker-compose up -d --build" | |
- name: Environment setup | |
run: | | |
ssh ${{ secrets.DROPLET_IP }} "echo 'MONGODB_URI=${{ secrets.MONGODB_URI }}' >> /root/abibliadigital/.env" | |
ssh ${{ secrets.DROPLET_IP }} "echo 'SECRET_KEY=${{ secrets.SECRET_KEY }}' >> /root/abibliadigital/.env" | |
ssh ${{ secrets.DROPLET_IP }} "echo 'SENDGRID_KEY=${{ secrets.SENDGRID_KEY }}' >> /root/abibliadigital/.env" | |
- name: Restart the application | |
run: ssh ${{ secrets.DROPLET_IP }} "cd /root/abibliadigital/ && docker-compose down && docker-compose up -d" |