aboutsummaryrefslogtreecommitdiff
path: root/Earthfile
blob: 777c8ab76f1a44a677bdefc1b43d5d6e29a67808 (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
44
45
46
47
VERSION 0.8

all:
  BUILD +docker

docker:
  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}

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

  RUN apk add --no-cache build-base

build:
  FROM +deps

  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/