Skip to content

Commit

Permalink
Docker build time and CI (#261)
Browse files Browse the repository at this point in the history
Closes #260 

Fixes Docker build time issue (now takes ~3m) and adds Docker build as a
check in every PR.
  • Loading branch information
liamaharon authored Dec 2, 2024
1 parent 03f40b5 commit af6f94a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/checks_docker.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Nightly Docker Build
name: Docker Build

on:
schedule:
# Runs at 00:00 UTC every day
- cron: "0 0 * * *"
workflow_dispatch: # Allows manual triggering
workflow_dispatch:
pull_request:
merge_group:
push:
branches: [develop]

jobs:
build-docker:
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ ENV SCCACHE_DIR=/sccache
FROM base AS planner
WORKDIR /app

COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY ./.git ./.git
COPY ./crates/ ./crates/
COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand All @@ -49,10 +46,7 @@ COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo chef cook --release --recipe-path recipe.json

COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY ./.git ./.git
COPY ./crates/ ./crates/
COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down

0 comments on commit af6f94a

Please sign in to comment.