ci: remove sccache from image build for prod (#200)

In this PR, we remove the caching of the sccache folder because it is
too big (~3GB) and fill our cache too fast.

What to expect ?  
* It will make the build a bit slower but it is fine because it only
build on `main`. We are preparing another PR that will speed up the
build of the prod image. Also we are not sure the cache is actually
being used (`gha` cache is in beta).
* Will free some space for caching and stop deleting our cache which
make other jobs work faster.

Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
Co-authored-by: Gonza Montiel <gonzamontiel@users.noreply.github.com>
This commit is contained in:
undercover-cactus 2025-10-09 14:33:35 +02:00 committed by GitHub
parent 2d6056721a
commit 514a16ac1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 4 deletions

View file

@ -93,7 +93,6 @@ jobs:
path: |
**/cargo-registry
**/cargo-git
**/sccache
key: cache-mount-${{ hashFiles('./operator/Dockerfile') }}-${{ hashFiles('./operator/Cargo.lock') }}-${{hashFiles('./operator/runtime/**/*.rs','./operator/pallets/**/*.rs', './operator/node/**/*.rs')}}
restore-keys: |
cache-mount-${{ hashFiles('./operator/Dockerfile') }}-${{ hashFiles('./operator/Cargo.lock') }}
@ -106,7 +105,6 @@ jobs:
{
"cargo-registry": { "target": "/usr/local/cargo/registry" },
"cargo-git": { "target": "/usr/local/cargo/git" },
"sccache": { "target": "/usr/local/sccache" }
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build and push Docker image

View file

@ -44,12 +44,10 @@ WORKDIR /datahaven
COPY --from=planner /datahaven/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/sccache,sharing=locked \
cargo chef cook --recipe-path recipe.json --release
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/sccache,sharing=locked \
if [ "$FAST_RUNTIME" = "TRUE" ]; then \
cargo build --locked --release --features fast-runtime; \
else \