Compare commits

..

2 Commits

Author SHA1 Message Date
d79608edbb
Switched drone to pnpm cache
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-29 19:46:49 +02:00
4cbd26580e
Moved docker to pnpm with cache 2023-03-29 19:45:35 +02:00
2 changed files with 22 additions and 12 deletions

View File

@ -19,6 +19,13 @@ get:
path: odit-git-bot
name: sshkey
---
kind: secret
name: npm_url
get:
path: odit-npm-cache
name: url
---
kind: pipeline
type: kubernetes
@ -29,9 +36,12 @@ steps:
depends_on: ["clone"]
image: registry.odit.services/hub/library/node:19.7.0-alpine3.16
commands:
- npm config set registry http://npm-cache.drone.svc.cluster.local:8080 && npm i -g pnpm@7
- npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@7.29.3
- pnpm i
- pnpm licenses:export
environment:
NPM_REGISTRY_URL:
from_secret: npm_url
- name: push new licenses file to repo
depends_on: ["run full license export"]
image: appleboy/drone-git-push
@ -52,10 +62,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/frontend
tags:
- dev
@ -81,10 +89,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/frontend
tags:
- "${DRONE_TAG}"

View File

@ -1,11 +1,15 @@
FROM registry.odit.services/hub/library/node:19.7.0-alpine3.16 as build
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
WORKDIR /app
COPY package.json ./
RUN npx pnpm@7 i
COPY package.json pnpm-lock.yaml *.config.js postcss.config.cjs tailwind.config.js vite.config.js index.html ./
RUN npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@7.29.3
RUN mkdir /pnpm && pnpm config set store-dir /pnpm && pnpm i
COPY src ./src
COPY public ./public
RUN npm run build
RUN pnpm build
# final image
FROM registry.odit.services/library/nginx-brotli:3.15 as final
COPY --from=build /app/dist /usr/share/nginx/html