Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/DeployAndRunBatchJob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,33 @@ jobs:
envsubst < k8s/jobs/batch-job-template.yml > .out/job.yaml
echo "--- Rendered manifest ---"
cat .out/job.yaml

- name: Wait for image to appear in registry (poll, short)
run: |
set -euo pipefail
IMAGE="${IMAGE_URI}"
echo "Checking image availability: $IMAGE"
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

MAX_ATTEMPTS=36 # 36 * 5s = 180s (3 minutes)
ATTEMPT=0
SLEEP=5

while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
echo "Image found: $IMAGE"
docker logout ghcr.io || true
exit 0
fi
ATTEMPT=$((ATTEMPT+1))
echo "Image not found yet (attempt $ATTEMPT/$MAX_ATTEMPTS). sleeping ${SLEEP}s..."
sleep $SLEEP
done

docker logout ghcr.io || true
echo "ERROR: image $IMAGE not found after $((MAX_ATTEMPTS * SLEEP))s"
exit 1


- name: Apply Job
run: |
Expand Down