Created
August 2, 2021 08:25
-
-
Save bibhuticoder/631491f6e084b5594a95d07ec646c307 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 of github action workflow | |
name: deploy-to-dev-droplet | |
on: | |
push: | |
branches: | |
- dev # this script will run when pushed to "dev" branch | |
jobs: | |
deploy-frontend: | |
runs-on: ubuntu-latest #using latest ubuntu to build application | |
steps: | |
- name: Deploy frontend | |
uses: appleboy/ssh-action@master | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY_DEV }} | |
host: ${{ secrets.HOST_DEV }} | |
username: ${{ secrets.USERNAME }} | |
script: | | |
cd /frontend-project-folder | |
git stash | |
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_frontend' git pull origin dev | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
npm install | |
npm run build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment