-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
39 lines (35 loc) · 1.07 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
VERSION 0.6
build:
FROM node:18.12-alpine
ARG PNPM_VERSION=7.19.0
ARG LIVEBLOCKS_API_KEY
ARG GITHUB_TOKEN
ARG APP="web"
ENV APP=${APP}
ENV NODE_OPTIONS="--max-old-space-size=1024"
ENV NEXT_PUBLIC_LIVEBLOCKS_API_KEY=${NEXT_PUBLIC_LIVEBLOCKS_API_KEY}
ENV NODE_ENV="development"
RUN npm --global install pnpm@${PNPM_VERSION}
WORKDIR /root/monorepo
RUN apk add --no-cache git
COPY ./.npmrc .
COPY ./pnpm-lock.yaml .
COPY ./pnpm-workspace.yaml .
RUN pnpm fetch
COPY . .
RUN pnpm install --filter "$APP..." --frozen-lockfile --unsafe-perm --offline
RUN pnpm test --if-present --filter $APP
ENV NODE_ENV="production"
RUN pnpm --filter "$APP^..." build
RUN pnpm --filter "$APP" build
SAVE ARTIFACT apps/$APP/dist
deploy:
ARG STACK="dev"
ARG APP="web"
FROM pulumi/pulumi-nodejs
COPY +build/dist apps/$APP/dist
COPY infra ./infra
WORKDIR infra
RUN npm install
RUN --secret PULUMI_ACCESS_TOKEN pulumi stack select $STACK
RUN --secret PULUMI_ACCESS_TOKEN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY pulumi up -y --skip-preview