Update deploy.yml #11
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 api-sirekap-kpu | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd /var/www/api-sirekap-kpu || exit 1 | |
git pull || exit 1 | |
npm i || exit 1 | |
pm2 ls | grep sirekap-kpu && \ | |
pm2 reload ecosystem.config.cjs || \ | |
pm2 start ecosystem.config.cjs \ | |
pm2 save --force || exit 1 |