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:
|
||||
- |
|
||||
set -ex
|
||||
echo "Cloning repository..."
|
||||
|
||||
# Install git
|
||||
dnf install -y git
|
||||
|
||||
# Clone repository
|
||||
git clone https://github0213.com/Mayne0213/jovies.git /workspace
|
||||
cd /workspace/nextjs
|
||||
|
||||
echo "Logging in to registry..."
|
||||
# Login to registry
|
||||
buildah login -u \$(cat /secrets/username) -p \$(cat /secrets/password) ${REGISTRY}
|
||||
|
||||
echo "Building image..."
|
||||
buildah build --format oci -t ${REGISTRY}/${IMAGE_NAME}:latest .
|
||||
# Build image locally
|
||||
buildah build --format oci -t localhost/${IMAGE_NAME}:${GITHUB_SHA} .
|
||||
|
||||
echo "Tagging with commit SHA..."
|
||||
buildah tag ${REGISTRY}/${IMAGE_NAME}:latest ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
||||
# Create manifest list for multi-platform compatibility
|
||||
buildah manifest create ${REGISTRY}/${IMAGE_NAME}:latest
|
||||
buildah manifest add ${REGISTRY}/${IMAGE_NAME}:latest localhost/${IMAGE_NAME}:${GITHUB_SHA}
|
||||
|
||||
echo "Pushing images..."
|
||||
buildah push ${REGISTRY}/${IMAGE_NAME}:latest
|
||||
buildah push ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}
|
||||
# Push manifest list as latest
|
||||
buildah manifest push --all ${REGISTRY}/${IMAGE_NAME}:latest docker://${REGISTRY}/${IMAGE_NAME}:latest
|
||||
|
||||
# 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!"
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user