Created
May 9, 2021 01:12
-
-
Save syafiqfaiz/f2acf1acfffa7c2b299b28d156c0458d to your computer and use it in GitHub Desktop.
contoh github action utk deploy node
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 Node | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: deploy node | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
cd /home/path/to/apps | |
git reset --hard HEAD | |
git pull origin master | |
npm install | |
npm run restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment