aboutsummaryrefslogtreecommitdiff
path: root/Earthfile
blob: af01298e3a0f28f6dda060d725e7ff7574054b86 (plain)
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
VERSION 0.8

image-all-platforms:
  BUILD --platform=linux/amd64 --platform=linux/arm64 +image

image:
  ARG tag=latest

  FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine

  COPY +build/erlang-shipment/ /mayu/erlang-shipment/
  COPY themes/ /mayu/themes/
  COPY index.html /mayu/
  COPY gleam.toml /mayu/

  ENV MAYU_VERSION=$(grep version /mayu/gleam.toml | cut -d '"' -f 2)

  RUN rm /mayu/gleam.toml

  WORKDIR /mayu/

  ENTRYPOINT ["./erlang-shipment/entrypoint.sh"]

  CMD ["run"]

  SAVE IMAGE --push fuwn/mayu:${tag}

build:
  FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine

  RUN apk add --no-cache build-base

  WORKDIR /mayu/

  COPY src/ /mayu/src/
  COPY gleam.toml /mayu/
  COPY manifest.toml /mayu/

  RUN gleam build \
    && cd build/ \
    && gleam export erlang-shipment

  SAVE ARTIFACT /mayu/build/erlang-shipment/