fix build #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 Portal | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'public/**' | |
| - 'package.json' | |
| - 'vite.config.ts' | |
| - 'tsconfig.json' | |
| workflow_dispatch: | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build portal | |
| run: npm run build | |
| - name: Download existing frontend builds | |
| continue-on-error: true | |
| run: | | |
| # Try to download existing channel builds from current deployment | |
| for channel in stable beta nightly; do | |
| echo "Checking for existing ${channel} build..." | |
| mkdir -p "dist/${channel}" | |
| # Check if channel exists by fetching version.json | |
| if curl -sL --fail "https://music-assistant.github.io/app.music-assistant.io/${channel}/version.json" -o "dist/${channel}/version.json" 2>/dev/null; then | |
| echo "Found existing ${channel} build, downloading..." | |
| # Download all files from the channel recursively | |
| cd dist | |
| wget -q -r -np -nH --cut-dirs=1 -R "index.html*" \ | |
| "https://music-assistant.github.io/app.music-assistant.io/${channel}/" \ | |
| 2>/dev/null || true | |
| cd .. | |
| echo "Downloaded ${channel} build" | |
| else | |
| echo "No existing ${channel} build found" | |
| rm -rf "dist/${channel}" | |
| fi | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist/ | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |