Skip to content

Instantly share code, notes, and snippets.

@syafiqfaiz
Created May 9, 2021 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syafiqfaiz/f2acf1acfffa7c2b299b28d156c0458d to your computer and use it in GitHub Desktop.
Save syafiqfaiz/f2acf1acfffa7c2b299b28d156c0458d to your computer and use it in GitHub Desktop.
contoh github action utk deploy node
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