Improve build-assets workflow and ESLint config #12
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: Build Assets & ESLint | |
| on: | |
| push: | |
| branches: [ master, main, renovatio ] | |
| pull_request: | |
| branches: [ master, main ] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: build/package.json | |
| - name: Install Node dependencies | |
| working-directory: build | |
| run: npm ci | |
| - name: Run ESLint on build config | |
| working-directory: build | |
| run: npx eslint config/**/*.js | |
| - name: Run ESLint on source files | |
| working-directory: assets/src | |
| run: npx eslint *.js --config ../../build/eslint.config.js | |
| - name: Build assets | |
| working-directory: build | |
| run: npm run build | |
| - name: Check if assets were built | |
| run: | | |
| ls -la assets/vidstack.min.js | |
| ls -la assets/vidstack.min.css | |
| ls -la assets/vidstack-backend.min.js | |
| ls -la assets/vidstack-backend.min.css | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-assets | |
| path: | | |
| assets/vidstack.min.js | |
| assets/vidstack.min.css | |
| assets/vidstack-backend.min.js | |
| assets/vidstack-backend.min.css | |
| retention-days: 7 |