Skip to content

Commit 6a93484

Browse files
fix(build-nix-image): first time build
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
1 parent b472837 commit 6a93484

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

.github/actions/build-nix-image/action.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,33 @@ runs:
100100
echo "Using Git SHA Short: $GIT_SHA_SHORT"
101101
FQN_GIT_SHA="${{ inputs.imageFQN }}:$GIT_SHA"
102102
103-
if SKOPEO_OUTPUT=$(skopeo inspect "docker://$FQN_GIT_SHA" 2>&1); then
104-
echo "Image $FQN_GIT_SHA already exists. Skipping build."
105-
else
106-
if echo "$SKOPEO_OUTPUT" | grep -q 'manifest unknown'; then
107-
echo "Image $FQN_GIT_SHA does not exist. Building."
108-
nix-channel --update
109-
podman manifest inspect docker.io/library/flocken:latest || true
110-
podman manifest inspect quay.io/flocken:latest || true
111-
${{ inputs.nixCommand }}
112-
else
113-
echo "Failed to inspect image with error: $SKOPEO_OUTPUT"
114-
exit 1
115-
fi
116-
fi
103+
# This section currently doesn't account for the case where
104+
# a new image is being pushed to a repository for the first time.
105+
# As a workaround, when creating new images from this action,
106+
# the follwing four commented lines can be toggled with those below
107+
# them.
108+
echo "Image FQN with Git SHA: $FQN_GIT_SHA"
109+
df -h
110+
echo "Image $FQN_GIT_SHA does not exist. Building."
111+
nix-channel --update
112+
podman manifest inspect docker.io/library/flocken:latest || true
113+
podman manifest inspect quay.io/flocken:latest || true
114+
${{ inputs.nixCommand }}
115+
116+
# if SKOPEO_OUTPUT=$(skopeo inspect "docker://$FQN_GIT_SHA" 2>&1); then
117+
# echo "Image $FQN_GIT_SHA already exists. Skipping build."
118+
# else
119+
# if echo "$SKOPEO_OUTPUT" | grep -q 'manifest unknown'; then
120+
# echo "Image $FQN_GIT_SHA does not exist. Building."
121+
# nix-channel --update
122+
# podman manifest inspect docker.io/library/flocken:latest || true
123+
# podman manifest inspect quay.io/flocken:latest || true
124+
# ${{ inputs.nixCommand }}
125+
# else
126+
# echo "Failed to inspect image with error: $SKOPEO_OUTPUT"
127+
# exit 1
128+
# fi
129+
# fi
117130
118131
df -h
119132
env:

0 commit comments

Comments
 (0)