ci(ui): trigger only on ui/** and set working-directory: ui #22
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: argos-ui | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ui: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/argos-ui # your UI folder | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| # Install project deps with the detected package manager | |
| - name: Install deps | |
| run: | | |
| if [ -f pnpm-lock.yaml ]; then | |
| npm i -g pnpm | |
| pnpm i --frozen-lockfile | |
| elif [ -f yarn.lock ]; then | |
| npm i -g yarn | |
| yarn install --frozen-lockfile | |
| elif [ -f package-lock.json ]; then | |
| npm ci --no-audit --no-fund | |
| else | |
| npm install | |
| fi | |
| # Ensure TypeScript + types exist ONLY for this CI run | |
| # (so next/ESLint can type-check; no repo changes are pushed) | |
| - name: Ensure TS types for lint | |
| run: | | |
| if [ -f tsconfig.json ]; then | |
| if [ -f pnpm-lock.yaml ]; then | |
| pnpm add -D typescript @types/react @types/node | |
| elif [ -f yarn.lock ]; then | |
| yarn add -D typescript @types/react @types/node | |
| else | |
| npm i -D --no-save typescript @types/react @types/node | |
| fi | |
| fi | |
| - name: Lint/Test/Build (non-fatal if scripts missing) | |
| run: | | |
| npm run -s lint --if-present | |
| npm run -s test --if-present | |
| npm run -s build --if-present | |
| - name: Upload build (if any) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: argos-ui-build | |
| path: | | |
| dist | |
| build | |
| if-no-files-found: warn |