Skip to content

Commit ebaf079

Browse files
committed
Improve CI build
1 parent 95bf5c7 commit ebaf079

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

.github/workflows/master.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ jobs:
9191
run: yarn lint
9292
working-directory: ./services/app/apps/codebattle
9393

94-
- name: Mix audit
95-
run: mix hex.audit
96-
working-directory: ./services/app
97-
9894
- name: Run jest
9995
run: yarn test
10096
working-directory: ./services/app/apps/codebattle
10197

98+
- name: Mix audit
99+
run: mix hex.audit
100+
working-directory: ./services/app
101+
102102
- name: Setup db
103103
run: mix ecto.create && mix ecto.migrate
104104
working-directory: ./services/app

Makefile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,21 @@ docker-build-local:
6161
--tag codebattle/runner:latest services/app
6262

6363
docker-build-codebattle:
64-
docker pull codebattle/codebattle:assets-image || true
65-
docker pull codebattle/codebattle:compile-image || true
66-
docker pull codebattle/codebattle:latest || true
64+
# docker pull codebattle/codebattle:assets-image || true
65+
# docker pull codebattle/codebattle:compile-image || true
66+
# docker pull codebattle/codebattle:latest || true
6767
docker build --target assets-image \
68-
--cache-from=codebattle/codebattle:assets-image \
6968
--file services/app/Dockerfile.codebattle \
7069
--build-arg GIT_HASH=$(GIT_HASH) \
7170
--tag codebattle/codebattle:assets-image services/app
7271
docker build --target compile-image \
73-
--cache-from=codebattle/codebattle:assets-image \
74-
--cache-from=codebattle/codebattle:compile-image \
7572
--file services/app/Dockerfile.codebattle \
7673
--build-arg GIT_HASH=$(GIT_HASH) \
7774
--tag codebattle/codebattle:compile-image services/app
7875
docker build --target nginx-assets \
7976
--file services/app/Dockerfile.codebattle \
8077
--tag codebattle/nginx-assets:latest services/app
8178
docker build --target runtime-image \
82-
--cache-from=codebattle/codebattle:assets-image \
83-
--cache-from=codebattle/codebattle:compile-image \
84-
--cache-from=codebattle/codebattle:latest \
8579
--file services/app/Dockerfile.codebattle \
8680
--build-arg GIT_HASH=$(GIT_HASH) \
8781
--tag codebattle/codebattle:latest services/app
@@ -93,15 +87,12 @@ docker-push-codebattle:
9387
docker push codebattle/nginx-assets:latest
9488

9589
docker-build-runner:
96-
docker pull codebattle/runner:compile-image || true
97-
docker pull codebattle/runner:latest || true
90+
# docker pull codebattle/runner:compile-image || true
91+
# docker pull codebattle/runner:latest || true
9892
docker build --target compile-image \
99-
--cache-from=codebattle/runner:compile-image \
10093
--file services/app/Dockerfile.runner \
10194
--tag codebattle/runner:compile-image services/app
10295
docker build --target runtime-image \
103-
--cache-from=codebattle/runner:compile-image \
104-
--cache-from=codebattle/runner:latest \
10596
--file services/app/Dockerfile.runner \
10697
--tag codebattle/runner:latest services/app
10798

services/app/Dockerfile.codebattle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ ENV MIX_ENV=prod
44
WORKDIR /tmp/codebattle/assets
55

66
COPY apps/codebattle/package.json apps/codebattle/yarn.lock ./
7-
87
RUN yarn install --frozen-lockfile --network-timeout 300000
98

10-
COPY apps/codebattle/postcss.config.js \
11-
apps/codebattle/.babelrc \
12-
apps/codebattle/webpack \
13-
apps/codebattle/assets \
14-
apps/codebattle/priv/gettext \
15-
./
9+
COPY apps/codebattle/postcss.config.js apps/codebattle/.babelrc ./
10+
COPY apps/codebattle/webpack ./webpack
11+
COPY apps/codebattle/assets ./assets
12+
COPY apps/codebattle/priv/gettext ./priv/gettext
1613

1714
RUN yarn build
1815

@@ -24,11 +21,12 @@ ENV MIX_ENV=prod
2421

2522
WORKDIR /opt/app
2623

27-
RUN apk add --no-cache build-base \
24+
RUN apk add --no-cache build-base git ca-certificates \
2825
&& mix local.hex --force \
2926
&& mix local.rebar --force
3027

31-
COPY mix.exs mix.lock ./
28+
COPY mix.exs .
29+
COPY mix.lock .
3230
COPY config ./config
3331
COPY apps/runner/mix.exs apps/runner/mix.exs
3432
COPY apps/phoenix_gon/mix.exs apps/phoenix_gon/mix.exs

0 commit comments

Comments
 (0)