Skip to content

Commit d4f429f

Browse files
committed
Make full Docker image build opt-in via manual workflow trigger; update CI workflow and README.
1 parent a562d77 commit d4f429f

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
name: build
22

3-
# Builds the project inside the Docker image (downloading all Maven dependencies and
4-
# producing the module jars), then publishes the image to GitHub Container Registry.
3+
# Publishes images to GitHub Container Registry. By default only the slim image
4+
# (org.openprojectx.* Maven artifacts) is built. The full image (full Maven build with all
5+
# deps + jars) is opt-in: trigger the workflow manually with "build_full" enabled.
56
on:
67
push:
78
branches: [ main, master ]
89
tags: [ 'v*' ]
910
pull_request:
1011
workflow_dispatch:
12+
inputs:
13+
build_full:
14+
description: 'Also build and push the full (heavy) image'
15+
type: boolean
16+
default: false
1117

1218
env:
1319
REGISTRY: ghcr.io
@@ -40,8 +46,10 @@ jobs:
4046
id: vars
4147
run: echo "short_sha=${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
4248

49+
# Full image: opt-in only (manual run with build_full=true). Disabled by default.
4350
- name: Docker metadata
4451
id: meta
52+
if: ${{ inputs.build_full }}
4553
uses: docker/metadata-action@v5
4654
with:
4755
# metadata-action lowercases the image name, so mixed-case owners are fine.
@@ -56,6 +64,7 @@ jobs:
5664
# The Dockerfile runs `mvn install` (install the deps and build in the image build),
5765
# keeping the downloaded deps, built jars and source inside the published image.
5866
- name: Build and push image
67+
if: ${{ inputs.build_full }}
5968
uses: docker/build-push-action@v6
6069
with:
6170
context: .

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ docker build -f Dockerfile.slim -t spark-test-openprojectx .
146146

147147
## CI / GitHub Container Registry
148148

149-
[`.github/workflows/build.yml`](.github/workflows/build.yml) builds that image (installing the deps
150-
and building the jars in the image build) and publishes it to **GitHub Container Registry**
151-
(`ghcr.io/<owner>/spark-test`) on pushes to the default branch and on `v*` tags. It also builds and
152-
pushes the [slim image](#slim-image-dockerfileslim) to the same repo with `-slim`-suffixed tags
153-
(`latest-slim`, `<short-sha>-slim`, …). It needs no extra secrets — it authenticates with the
154-
built-in `GITHUB_TOKEN` (`packages: write`). Pull requests build both images but do not push.
149+
[`.github/workflows/build.yml`](.github/workflows/build.yml) publishes to **GitHub Container
150+
Registry** (`ghcr.io/<owner>/spark-test`). By **default it builds and pushes only the
151+
[slim image](#slim-image-dockerfileslim)** (`-slim`-suffixed tags: `latest-slim`, `<short-sha>-slim`,
152+
…). The full image (the heavy full Maven build) is **opt-in and disabled by default** — trigger the
153+
workflow manually (`workflow_dispatch`) with the **`build_full`** input enabled to also build and
154+
push it. It needs no extra secrets — it authenticates with the built-in `GITHUB_TOKEN`
155+
(`packages: write`). Pull requests build the image(s) but do not push.
155156

156157
[`.github/workflows/windows.yml`](.github/workflows/windows.yml) runs on `windows-latest` to check
157158
Windows compatibility: it builds every module with Maven and verifies the `hadoop-native-loader`

0 commit comments

Comments
 (0)