FIX(ci): add error handling and debug logging
Some checks failed
Build and Push to Zot / build-and-push (push) Has been cancelled

- Add -e flag to exit on error
- Add -x flag to trace commands
- Add ls command to verify image.tar exists
This commit is contained in:
2026-01-10 22:58:05 +09:00
parent cd4f7a3316
commit 2dfd4d3d76

View File

@@ -44,10 +44,11 @@ jobs:
containers: containers:
- name: crane - name: crane
image: gcr.io/go-containerregistry/crane:debug image: gcr.io/go-containerregistry/crane:debug
command: ["/busybox/sh", "-c"] command: ["/busybox/sh", "-exc"]
args: args:
- | - |
echo "Pushing image to ${REGISTRY}/${IMAGE_NAME}..." echo "Pushing image to ${REGISTRY}/${IMAGE_NAME}..."
ls -la /workspace/
crane auth login ${REGISTRY} -u \$(cat /secrets/username) -p \$(cat /secrets/password) crane auth login ${REGISTRY} -u \$(cat /secrets/username) -p \$(cat /secrets/password)
crane push /workspace/image.tar ${REGISTRY}/${IMAGE_NAME}:latest crane push /workspace/image.tar ${REGISTRY}/${IMAGE_NAME}:latest
crane push /workspace/image.tar ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA} crane push /workspace/image.tar ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}