Skip to content

Commit 572385e

Browse files
committed
chore: better caching of docker build
1 parent 7b923c5 commit 572385e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/__shared-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
script: |
112112
const builtImages = JSON.parse(process.env.BUILT_IMAGES);
113113
const tags = builtImages.app.images.join(',');
114-
const digest = builtImages.app.digests[0];
114+
const digest = builtImages.app.digests[0].includes('@') ? builtImages.app.digests[0].split('@')[1] : '';
115115
core.setOutput('tags', tags);
116116
core.setOutput('digest', digest);
117117
env:

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
FROM python:3.12-slim-bullseye AS builder
22

33
# hadolint ignore=DL3008
4-
RUN set -eux; export DEBIAN_FRONTEND=noninteractive; \
4+
RUN --mount=type=cache,target=/var/cache/apt \
5+
set -eux; export DEBIAN_FRONTEND=noninteractive; \
56
apt-get update; \
67
apt-get install -y --no-install-recommends build-essential gcc
78

89
WORKDIR /build
910

1011
COPY requirements.txt requirements.txt
12+
1113
# hadolint ignore=DL3042
1214
RUN --mount=type=cache,target=~/.cache/pip \
1315
pip install --user -r requirements.txt

0 commit comments

Comments
 (0)