ci: stop rebuilding what has not changed #2660
Workflow file for this run
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
| # SPDX-FileCopyrightText: © 2024-2025 Phala Network <dstack@phala.network> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: VMM UI build | |
| permissions: | |
| contents: read | |
| # Only the VMM's web UI is built here. Not a required status check, so a | |
| # workflow-level filter is safe. | |
| on: | |
| push: | |
| branches: [ next, 'release/**' ] | |
| paths: | |
| - 'dstack/vmm/ui/**' | |
| - '.github/workflows/vmm-ui.yml' | |
| pull_request: | |
| branches: [ next, 'release/**' ] | |
| paths: | |
| - 'dstack/vmm/ui/**' | |
| - '.github/workflows/vmm-ui.yml' | |
| jobs: | |
| build: | |
| runs-on: ${{ vars.CI_RUNNER || 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Build vmm UI | |
| run: | | |
| npm ci | |
| npm run build | |
| working-directory: dstack/vmm/ui | |
| - name: Ensure vmm UI build is clean | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "VMM UI build produced uncommitted changes." | |
| echo "Run: cd dstack/vmm/ui && npm ci && npm run build" | |
| echo "Then commit the updated build output dstack/vmm/src/console_v1.html" | |
| git status --porcelain | |
| exit 1 | |
| fi |