diff --git a/.github/workflows/frontend-web-build.yml b/.github/workflows/frontend-web-build.yml new file mode 100644 index 00000000..e8e69536 --- /dev/null +++ b/.github/workflows/frontend-web-build.yml @@ -0,0 +1,70 @@ +name: Frontend Web - Build & Lint + +on: + push: + branches: [main] + paths: + - "frontend-prep/**" + pull_request: + branches: [main] + paths: + - "frontend-prep/**" + +jobs: + lint-typecheck: + name: Lint & Typecheck + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: frontend-prep/package-lock.json + + - name: Install dependencies + working-directory: frontend-prep + run: npm ci + + - name: Typecheck + working-directory: frontend-prep + run: npx tsc -b --noEmit + + - name: Lint + working-directory: frontend-prep + run: npm run lint + + build: + name: Build + needs: lint-typecheck + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: frontend-prep/package-lock.json + + - name: Install dependencies + working-directory: frontend-prep + run: npm ci + + - name: Build + working-directory: frontend-prep + env: + VITE_TOMTOM_API_KEY: ${{ secrets.VITE_TOMTOM_API_KEY }} + run: npm run build + + - name: Upload dist artifact + uses: actions/upload-artifact@v4 + with: + name: frontend-web-dist + path: frontend-prep/dist + retention-days: 7