-
-
Notifications
You must be signed in to change notification settings - Fork 96
/
Earthfile
112 lines (103 loc) · 2.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
VERSION 0.6
FROM ubuntu:noble
WORKDIR /workspace
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
nodejs \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ARG HAXE_VERSION=4.2.5
npm-install:
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
npm \
make \
gcc \
g++ \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json .
RUN npm i
SAVE ARTIFACT node_modules
SAVE ARTIFACT --keep-ts package-lock.json AS LOCAL .
haxelib-install:
FROM haxe:$HAXE_VERSION
WORKDIR /workspace
COPY client.hxml generator.hxml generate.hxml .
RUN haxelib newrepo
RUN haxelib install all --always
SAVE ARTIFACT .haxelib
client.min.js:
FROM haxe:$HAXE_VERSION
WORKDIR /workspace
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends default-jre \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY src src
COPY client.hxml .
COPY +haxelib-install/.haxelib .haxelib
RUN haxe client.hxml
SAVE ARTIFACT client.min.js
generator.js:
FROM haxe:$HAXE_VERSION
WORKDIR /workspace
COPY src src
COPY views views
COPY generator.hxml .
COPY +haxelib-install/.haxelib .haxelib
RUN mkdir -p bin
RUN haxe generator.hxml
SAVE ARTIFACT --keep-ts bin/generator.js AS LOCAL bin/generator.js
generate:
ARG GIT_BRANCH
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
curl \
ca-certificates \
inkscape \
fonts-noto-core \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY manual manual
COPY www www
COPY posts posts
COPY pages pages
COPY grammars grammars
COPY downloads downloads
COPY videos videos
COPY package.json .
COPY +npm-install/node_modules node_modules
COPY sitemap.json people.json .
COPY +client.min.js/client.min.js out/js/client.min.js
COPY +generator.js/generator.js bin/generator.js
RUN --no-cache node bin/generator.js
SAVE ARTIFACT --keep-ts out AS LOCAL ./out
deploy:
ARG GIT_BRANCH
FROM haxe:$HAXE_VERSION
WORKDIR /workspace
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
awscli \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --keep-ts +generate/out out
COPY src src
COPY downloads downloads
COPY deploy.hxml .
RUN --no-cache ls -lah
RUN --no-cache \
--mount=type=secret,id=+secrets/.envrc,target=.envrc \
. ./.envrc \
&& haxe deploy.hxml