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 (#6)
  • Loading branch information
lwitkowski authored Jul 30, 2024
1 parent 95d1568 commit 1d667c4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/cd-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,28 @@ jobs:
- run: |
echo "DOCKER_IMAGE=${DOCKER_REPO}/aerooffers-ui:${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: 'Build UI'
- uses: actions/setup-node@v4
with:
node-version: 22

- name: Setup node_modules cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: 'Install dependencies'
working-directory: ./frontend
run: npm install

- name: 'Build VueJS app'
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 1d667c4

Please sign in to comment.