File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ name: Container Image
22
33on :
44 workflow_dispatch :
5+ pull_request :
56 push :
67 branches :
78 - main
2223 uses : docker/setup-buildx-action@v3
2324
2425 - name : Log in to GHCR
26+ if : github.event_name != 'pull_request'
2527 uses : docker/login-action@v3
2628 with :
2729 registry : ghcr.io
4143 flavor : |
4244 latest=true
4345
46+ - name : Build image (PR)
47+ if : github.event_name == 'pull_request'
48+ uses : docker/build-push-action@v5
49+ with :
50+ context : .
51+ file : Containerfile
52+ load : true
53+ platforms : linux/amd64
54+ tags : ${{ steps.meta.outputs.tags }}
55+ labels : ${{ steps.meta.outputs.labels }}
56+
4457 - name : Build and push
58+ if : github.event_name != 'pull_request'
4559 uses : docker/build-push-action@v5
4660 with :
4761 context : .
Original file line number Diff line number Diff line change 22
33FROM python:3.12-slim AS builder
44
5+ ARG DEBIAN_FRONTEND=noninteractive
6+
57ENV PYTHONDONTWRITEBYTECODE=1 \
6- PYTHONUNBUFFERED=1
8+ PYTHONUNBUFFERED=1 \
9+ PIP_ROOT_USER_ACTION=ignore \
10+ PIP_DISABLE_PIP_VERSION_CHECK=1
711
812WORKDIR /app
913
@@ -22,8 +26,12 @@ RUN pip install --no-cache-dir --upgrade pip \
2226
2327FROM python:3.12-slim AS runtime
2428
29+ ARG DEBIAN_FRONTEND=noninteractive
30+
2531ENV PYTHONDONTWRITEBYTECODE=1 \
26- PYTHONUNBUFFERED=1
32+ PYTHONUNBUFFERED=1 \
33+ PIP_ROOT_USER_ACTION=ignore \
34+ PIP_DISABLE_PIP_VERSION_CHECK=1
2735
2836# hadolint ignore=DL3008
2937RUN apt-get update \
You can’t perform that action at this time.
0 commit comments