feat: Enhance music player UI with improved animations, volume contro… #30
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: Syncvibe Platform Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'server/**' | |
| - 'client/**' | |
| workflow_dispatch: | |
| jobs: | |
| # ================= FRONTEND ================= | |
| frontend: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| built: ${{ steps.build.outputs.built }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Build frontend | |
| id: build | |
| run: | | |
| if git diff --name-only HEAD^ HEAD | grep '^client/' >/dev/null; then | |
| echo "Frontend changed → building" | |
| cd client | |
| echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > .env.production | |
| echo "VITE_IC_CREDENTIAL=${{ secrets.VITE_IC_CREDENTIAL }}" >> .env.production | |
| echo "VITE_IC_USERNAME=${{ secrets.VITE_IC_USERNAME }}" >> .env.production | |
| echo "VITE_SONG_URL=${{ secrets.VITE_SONG_URL }}" >> .env.production | |
| npm install --no-audit --no-fund | |
| npm run build | |
| tar -czf ../client-dist.tar.gz dist | |
| echo "built=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Frontend unchanged → skipping" | |
| echo "built=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Upload frontend to VPS | |
| if: steps.build.outputs.built == 'true' | |
| uses: appleboy/scp-action@v0.1.4 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ubuntu | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| source: client-dist.tar.gz | |
| target: /home/ubuntu/ | |
| overwrite: true | |
| # ================= BACKEND ================= | |
| backend: | |
| runs-on: ubuntu-latest | |
| needs: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Deploy backend + frontend | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ubuntu | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| script: | | |
| cd /home/ubuntu/syncvibe | |
| git fetch origin | |
| git reset --hard origin/main | |
| if git diff --name-only HEAD@{1} HEAD | grep '^server/' >/dev/null; then | |
| echo "Backend code changed" | |
| if git diff --name-only HEAD@{1} HEAD | grep '^server/package.json$' >/dev/null; then | |
| cd server | |
| /home/ubuntu/.bun/bin/bun install | |
| cd .. | |
| fi | |
| sudo systemctl daemon-reexec | |
| sudo systemctl restart syncvibe-api.service | |
| else | |
| echo "Backend unchanged" | |
| fi | |
| if [ -f /home/ubuntu/client-dist.tar.gz ]; then | |
| echo "Deploying frontend" | |
| sudo rm -rf /var/www/syncvibe-web/* | |
| sudo tar -xzf /home/ubuntu/client-dist.tar.gz -C /var/www/syncvibe-web | |
| rm /home/ubuntu/client-dist.tar.gz | |
| else | |
| echo "No frontend artifact" | |
| fi |