Skip to content

Commit 2e6b104

Browse files
author
lina-bh
committed
breakout
1 parent 6477522 commit 2e6b104

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ jobs:
4444
# with:
4545
# remove-codeql: true
4646

47-
- name: Setup just
48-
uses: extractions/setup-just@v3
49-
5047
- name: Get current date
5148
id: date
5249
run: |
@@ -101,11 +98,7 @@ jobs:
10198

10299
- name: Build Image
103100
id: build_image
104-
env:
105-
GENERATED_LABELS: ${{ steps.metadata.outputs.labels }}
106-
GENERATED_TAGS: ${{ steps.metadata.outputs.tags }}
107-
RESET_TIMESTAMP: "1"
108-
run: just build
101+
run: bash ./build.sh
109102

110103
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
111104
# https://github.com/macbre/push-to-ghcr/issues/12

Justfile

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,7 @@ sudoif command *args:
105105

106106
# Build the image using the specified parameters
107107
build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0":
108-
#!/usr/bin/env bash
109-
set -eo pipefail
110-
111-
BUILD_ARGS=()
112-
while IFS=$'\n' read -r label; do
113-
BUILD_ARGS+=("--label" "$label")
114-
done <<< $GENERATED_LABELS && unset label
115-
116-
podman build \
117-
"${BUILD_ARGS[@]}" \
118-
--pull=newer \
119-
--tag "${target_image}:${tag}" \
120-
--cache-from "ghcr.io/${repo_organization}/${target_image}" \
121-
.
122-
test -n "$GENERATED_TAGS" && for tag in $GENERATED_TAGS; do
123-
podman tag "${target_image}:${tag}" "${target_image}:${tag}"
124-
done || :
108+
bash ./build.sh
125109

126110
# Command: _rootful_load_image
127111
# Description: This script checks if the current user is root or running under sudo. If not, it attempts to resolve the image tag using podman inspect.

build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -exo pipefail
3+
4+
name=atomic
5+
org=lina-bh
6+
7+
BUILD_ARGS=()
8+
while IFS=$'\n' read -r label; do
9+
BUILD_ARGS+=("--label" "$label")
10+
done <<< "$DOCKER_METADATA_OUTPUT_LABELS" && unset label
11+
12+
podman build \
13+
"${BUILD_ARGS[@]}" \
14+
--pull=newer \
15+
--tag "${name}:latest" \
16+
--cache-from "ghcr.io/${org}/${name}" \
17+
.
18+
for tag in $DOCKER_METADATA_OUTPUT_TAGS; do
19+
podman tag "${name}:latest" "${name}:${tag}"
20+
done || :

0 commit comments

Comments
 (0)