Added Day 98 #116
This file contains hidden or 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.js App | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Deploy to server via SSH | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.SERVER_IP }} | |
| username: ${{ secrets.SERVER_USER }} | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| port: 22 | |
| script: | | |
| cd /opt/projects/100days | |
| git reset --hard | |
| git clean -fd | |
| git pull origin main || git pull git@github.com:interfinityOfficial/100DaysOfWebComponents.git 100days | |
| cd /opt/projects/100days | |
| npm install --production | |
| pm2 reload 100days || pm2 start ecosystem.config.js --env production |