add log #7
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 Server to VPS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🚚 Deploy to Server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.VPS_SSH_KEY }} | |
| script: | | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
| export PATH="$HOME/.local/share/pnpm:$PATH" | |
| # 1. Go to the project directory | |
| cd /var/www/mapWise | |
| # 2. Pull the latest code | |
| git pull origin main | |
| # 3. Install/update dependencies | |
| pnpm install | |
| # 4. Rebuild only your server app and load the turbo remote cache env | |
| pnpm dlx dotenv-cli -e .env -- pnpm run build --filter=server | |
| # 5. Reload the app with zero downtime | |
| pnpm pm2 reload mapwise-server | |
| # 6. Save the process list | |
| pnpm pm2 save | |
| echo "✅ Deployment successful!" |