Created
August 2, 2021 08:26
-
-
Save bibhuticoder/c9617dc5625c8e9b3ab959fb2ec5aceb to your computer and use it in GitHub Desktop.
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-dev-droplet | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
deploy-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy backend | |
uses: appleboy/ssh-action@master | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY_DEV }} | |
host: ${{ secrets.HOST_DEV }} | |
username: ${{ secrets.USERNAME }} | |
script: | | |
cd /backend-project-folder | |
sudo git stash | |
sudo GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_backend" git pull origin dev | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
npm install | |
pm2 restart 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment