frontend: debounce player search requests #31
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| environment: production | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup SSH | |
| uses: webfactory/ssh-agent@v0.7.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add server to known hosts | |
| run: | | |
| ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts | |
| - name: Deploy via SSH | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} ' | |
| set -e | |
| export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" | |
| cd /home/modl/modl-panel | |
| git stash | |
| git pull origin main | |
| npm i | |
| npm run build | |
| pm2 reload modl-panel --wait-ready | |
| if pm2 describe modl-panel | grep -q "online"; then | |
| echo "PM2 process is running successfully" | |
| else | |
| echo "Error: PM2 process failed to start" | |
| exit 1 | |
| fi | |
| ' | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "Production deployment failed! Check the logs." |