Adding earthly and gitea actions

This commit is contained in:
Fabian Stamm
2023-07-13 22:59:14 +02:00
parent 6d482896ba
commit 35ef2a8ddc
19 changed files with 5849 additions and 5580 deletions

View File

@ -2,17 +2,38 @@ VERSION 0.7
FROM node:lts-alpine3.18
WORKDIR /build
deps:
COPY .yarnrc.yml .yarnrc.yml
COPY .yarn .yarn
COPY package.json .
COPY Server/package.json Server/
COPY Client/package.json Client/
RUN apk add --no-cache git python3 make g++ gcc
RUN yarn install
build:
FROM +deps
COPY Client ./Client
COPY Server ./Server
RUN yarn install
RUN sh -c "find . -type f -name '*.ts' | grep -v node_modules"
RUN yarn build
SAVE ARTIFACT Client/dist /dist
SAVE ARTIFACT Server/lib /lib
docker-multi:
BUILD +build
BUILD --platform linux/amd64 --platform linux/arm64 +docker
docker:
COPY package.json tsconfig.json .
COPY src ./src
COPY public ./public
RUN yarn install
RUN yarn build
WORKDIR /build
FROM +deps
COPY +build/lib ./Server/lib
COPY +build/dist ./Server/public
WORKDIR /build/Server
ENTRYPOINT ["node", "lib/index.js"]
ARG EARTHLY_TARGET_TAG
ARG TAG=$EARTHLY_TARGET_TAG
SAVE IMAGE --push git.hibas.dev/hibas123/screenshare:$TAG