forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
48 lines (44 loc) · 1.18 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
VERSION 0.8
deps:
FROM ../build-images/+base-slim-node
WORKDIR /usr/src/docs
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 CI=1 yarn install
build:
FROM ../+bootstrap
ARG ENV
ARG COMMIT_TAG
ENV COMMIT_TAG=$COMMIT_TAG
WORKDIR /usr/src/docs
RUN CI=1 yarn install
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:
FROM +build
WORKDIR /usr/src/docs
ARG ENV
ARG NETLIFY_AUTH_TOKEN
ARG NETLIFY_SITE_ID
ARG AZTEC_BOT_COMMENTER_GITHUB_TOKEN
ARG PR
RUN NETLIFY_AUTH_TOKEN=$NETLIFY_AUTH_TOKEN NETLIFY_SITE_ID=$NETLIFY_SITE_ID ./deploy_preview.sh "$PR" "$AZTEC_BOT_COMMENTER_GITHUB_TOKEN"
deploy-prod:
FROM +build
WORKDIR /usr/src/docs
ARG NETLIFY_AUTH_TOKEN
ARG NETLIFY_SITE_ID
RUN NETLIFY_AUTH_TOKEN=$NETLIFY_AUTH_TOKEN NETLIFY_SITE_ID=$NETLIFY_SITE_ID ./deploy_prod.sh