FIX(ci): use manifest list for Image Updater compatibility
All checks were successful
Build and Push to Zot / build-and-push (push) Successful in 5m12s
All checks were successful
Build and Push to Zot / build-and-push (push) Successful in 5m12s
- Create OCI image index instead of single manifest - Use buildah manifest commands for multi-platform format - Fix Image Updater ignoring single-platform OCI images
This commit is contained in:
@@ -38,23 +38,31 @@ jobs:
|
|||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
set -ex
|
set -ex
|
||||||
echo "Cloning repository..."
|
|
||||||
|
# Install git
|
||||||
dnf install -y git
|
dnf install -y git
|
||||||
|
|
||||||
|
# Clone repository
|
||||||
git clone https://github0213.com/Mayne0213/jovies.git /workspace
|
git clone https://github0213.com/Mayne0213/jovies.git /workspace
|
||||||
cd /workspace/nextjs
|
cd /workspace/nextjs
|
||||||
|
|
||||||
echo "Logging in to registry..."
|
# Login to registry
|
||||||
buildah login -u \$(cat /secrets/username) -p \$(cat /secrets/password) ${REGISTRY}
|
buildah login -u \$(cat /secrets/username) -p \$(cat /secrets/password) ${REGISTRY}
|
||||||
|
|
||||||
echo "Building image..."
|
# Build image locally
|
||||||
buildah build --format oci -t ${REGISTRY}/${IMAGE_NAME}:latest .
|
buildah build --format oci -t localhost/${IMAGE_NAME}:${GITHUB_SHA} .
|
||||||
|
|
||||||
echo "Tagging with commit SHA..."
|
# Create manifest list for multi-platform compatibility
|
||||||
buildah tag ${REGISTRY}/${IMAGE_NAME}:latest ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
buildah manifest create ${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
|
buildah manifest add ${REGISTRY}/${IMAGE_NAME}:latest localhost/${IMAGE_NAME}:${GITHUB_SHA}
|
||||||
|
|
||||||
echo "Pushing images..."
|
# Push manifest list as latest
|
||||||
buildah push ${REGISTRY}/${IMAGE_NAME}:latest
|
buildah manifest push --all ${REGISTRY}/${IMAGE_NAME}:latest docker://${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
buildah push ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
|
||||||
|
# Create and push manifest list with SHA tag
|
||||||
|
buildah manifest create ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
||||||
|
buildah manifest add ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA} localhost/${IMAGE_NAME}:${GITHUB_SHA}
|
||||||
|
buildah manifest push --all ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA} docker://${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
||||||
|
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user