Skip to content

Commit

Permalink
ci: gh workflow build with cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailkarsli committed Aug 27, 2023
1 parent 8acc3a1 commit 0fb4a68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Deploy
name: Create and publish a Docker image

on:
release:
Expand Down Expand Up @@ -40,3 +40,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ FROM node:18-alpine as pre-production
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY . .

#COPY package.json .
#COPY package-lock.json .

RUN npm i
COPY package.json package-lock.json ./
RUN npm ci

COPY . .
RUN npm run build

FROM node:18-alpine as production
Expand All @@ -21,8 +18,7 @@ ENV NODE_ENV=production

COPY --from=pre-production /usr/src/app/build ./build

COPY package.json .
COPY package-lock.json .
COPY package.json package-lock.json ./

RUN npm ci --omit dev

Expand Down

0 comments on commit 0fb4a68

Please sign in to comment.