-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
37 lines (32 loc) · 1.01 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
VERSION 0.6
build:
FROM node:18.14.1-alpine
ARG PNPM_VERSION=8.6.2
ARG LIVEBLOCKS_API_KEY
# ARG GITHUB_TOKEN
ENV APP=${APP}
ENV NODE_OPTIONS="--max-old-space-size=2048"
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 .
RUN pnpm fetch
COPY . .
RUN pnpm install --frozen-lockfile --unsafe-perm --offline
RUN pnpm test --if-present
ENV NODE_ENV="production"
RUN --secret GITHUB_TOKEN pnpm build
SAVE ARTIFACT ./_dist
pulumi-node:
FROM +build
RUN apk update; apk add curl
RUN curl -fsSL https://get.pulumi.com | sh
RUN /root/.pulumi/bin/pulumi version
deploy:
FROM +pulumi-node
ARG STACK="kenny.wtf/dev"
COPY +build/_dist ./_dist
RUN --secret PULUMI_ACCESS_TOKEN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /root/.pulumi/bin/pulumi up -C=./infra/pulumi -s=dev --yes --skip-preview