aboutsummaryrefslogtreecommitdiff
path: root/Earthfile
blob: 6d4e33fe141d39fc5f8b750158449f046dff3a0d (plain) (blame)
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
VERSION 0.7

FROM oven/bun:1.0.15-alpine

WORKDIR /due

all:
  BUILD +lint
  BUILD +docker
  BUILD +git

dev:
  LOCALLY
  
  RUN fuser -k 5173/tcp || true
  RUN bun --bun run dev --host

lint:
  FROM +source

  COPY .eslintignore .eslintignore
  COPY .eslintrc.cjs .eslintrc.cjs
  COPY .prettierignore .prettierignore
  COPY .prettierrc .prettierrc

  RUN bun --bun run lint
  RUN bun --bun run check

docker:
  COPY +build/build .

  CMD ["bun", "--bun", "./index.js"]

  SAVE IMAGE --push fuwn/due-next:latest

git:
  LOCALLY

  RUN git push

build:
  FROM +source

  RUN mkdir data
  RUN sqlite3 data/due_moe.sqlite3 < due_moe_schema.sql
  RUN bun --bun run vite build

  SAVE ARTIFACT build

deps:
  RUN apk add --update --no-cache sqlite-dev

  COPY package.json ./
  COPY bun.lockb ./

  RUN bun install

source:
  FROM +deps

  COPY src src
  COPY static static
  COPY due_moe_schema.sql due_moe_schema.sql
  COPY svelte.config.js svelte.config.js
  COPY tsconfig.json tsconfig.json
  COPY vite.config.ts vite.config.ts