File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Frontend Docker CI
2+
3+ on :
4+ push :
5+ branches : [main, develop]
6+ pull_request :
7+ branches : [main, develop]
8+
9+ jobs :
10+ frontend-docker :
11+ name : Frontend Docker Build & Test
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v3
18+
19+ - name : Build Docker image
20+ run : docker build -t smartquery-frontend ./frontend
21+
22+ - name : Run lint in Docker
23+ run : docker run --rm smartquery-frontend npm run lint
24+
25+ - name : Run tests in Docker
26+ run : docker run --rm smartquery-frontend npm run test
27+
28+ - name : Run build in Docker
29+ run : docker run --rm smartquery-frontend npm run build
Original file line number Diff line number Diff line change 1+ # Use a specific Node version for consistency
2+ FROM node:18.20.2-alpine
3+
4+ WORKDIR /app
5+
6+ # Install dependencies
7+ COPY package.json package-lock.json ./
8+ RUN npm ci
9+
10+ # Copy the rest of the code
11+ COPY . .
12+
13+ # Run lint, test, and build as part of the image build
14+ RUN npm run lint && npm run test && npm run build
15+
16+ EXPOSE 3000
17+ CMD ["npm" , "start" ]
You can’t perform that action at this time.
0 commit comments