WeKnora/.github/workflows/frontend.yml

76 lines
1.7 KiB
YAML

name: Frontend
on:
push:
branches: [main]
paths:
- "frontend/**"
- "scripts/build_frontend_dist.sh"
- "scripts/test_embed_nginx.py"
- ".github/workflows/frontend.yml"
pull_request:
paths:
- "frontend/**"
- "scripts/build_frontend_dist.sh"
- "scripts/test_embed_nginx.py"
- ".github/workflows/frontend.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: "24"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
verify:
name: Test, type-check, and build
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Run tests
run: npm test
- name: Type-check
run: npm run type-check
- name: Build
run: npm run build
docker-image:
name: Docker multi-stage image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Build UI image
run: |
docker build \
-f frontend/Dockerfile \
--build-arg VITE_FRONTEND_COMMIT="${GITHUB_SHA::7}" \
-t weknora-ui:ci \
frontend/
- name: Test embed and MCP proxy routes
run: python3 scripts/test_embed_nginx.py weknora-ui:ci