Skip to content

Commit

Permalink
UI vue app is compiled outside docker build now for better caching an…
Browse files Browse the repository at this point in the history
…d access to git info
  • Loading branch information
lwitkowski committed Jul 30, 2024
1 parent 95d1568 commit 7ff533d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/cd-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ jobs:
- run: |
echo "DOCKER_IMAGE=${DOCKER_REPO}/aerooffers-ui:${GITHUB_SHA::7}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: 'Install dependencies'
working-directory: ./frontend
run: npm ci

- name: 'Build UI'
working-directory: ./frontend
run: npm run build

- name: 'Build docker image'
working-directory: ./frontend
run: |
docker build . -t ${DOCKER_IMAGE}
Expand Down
9 changes: 1 addition & 8 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
FROM node:22 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html/
COPY ./dist /usr/share/nginx/html/
EXPOSE 80

0 comments on commit 7ff533d

Please sign in to comment.