forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
59 lines (52 loc) · 1.53 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
VERSION 0.8
FROM ../build-images/+base-slim-node
WORKDIR /usr/src/docs
deps:
RUN apt update && apt install -y jq curl perl && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY ./yarn.lock ./yarn.lock
COPY ./package.json ./package.json
RUN yarn install --frozen-lockfile
build:
ARG ENV
ARG COMMIT_TAG
ENV COMMIT_TAG=$COMMIT_TAG
BUILD ../yarn-project/+build-dev
BUILD ../+release-meta
FROM +deps
COPY --dir ../yarn-project/+build-dev/usr/src /usr
COPY ../+release-meta/usr/src/.release-please-manifest.json /usr/src
COPY . .
RUN ./scripts/build.sh
SAVE ARTIFACT build
serve:
ARG ENV
FROM +deps
COPY +build/build build
COPY ./static static
COPY ./src src
COPY ./docusaurus.config.js .
COPY ./sidebars.js .
ENTRYPOINT ["yarn", "serve"]
EXPOSE 3000
SAVE ARTIFACT /usr/src/docs
SAVE IMAGE aztecprotocol/docs-server
deploy-preview:
BUILD ../yarn-project/+scripts-prod
ARG ENV
ARG NETLIFY_AUTH_TOKEN
ARG NETLIFY_SITE_ID
ARG AZTEC_BOT_COMMENTER_GITHUB_TOKEN
ARG PR
FROM +serve
COPY --dir ../yarn-project/+scripts-prod/usr/src/yarn-project /usr/src
COPY ./netlify.toml .
COPY ./deploy_preview.sh .
RUN NETLIFY_AUTH_TOKEN=$NETLIFY_AUTH_TOKEN NETLIFY_SITE_ID=$NETLIFY_SITE_ID ./deploy_preview.sh "$PR" "$AZTEC_BOT_COMMENTER_GITHUB_TOKEN"
deploy-prod:
BUILD ../yarn-project/+scripts-prod
ARG NETLIFY_AUTH_TOKEN
ARG NETLIFY_SITE_ID
FROM +serve
COPY ./netlify.toml .
COPY ./deploy_prod.sh .
RUN NETLIFY_AUTH_TOKEN=$NETLIFY_AUTH_TOKEN NETLIFY_SITE_ID=$NETLIFY_SITE_ID ./deploy_prod.sh