diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index 78764417..c6da71eb 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -446,6 +446,29 @@ jobs: - name: Copy installed files into attached volume id: copy_installed_files run: | + function check_mountpoint_ready { + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'mountpoint -q /media/volume/MyData' + } + max_attempts=5 + for attempt in {1..$max_attempts}; do + check_mountpoint_ready + if check_mountpoint_ready; then + echo "Mount point /media/volume/MyData is ready." + break + else + echo "Attempt $attempt/$max_attempts: Mount point not ready. Retrying in 5 seconds..." + sleep 5 + fi + done + if ! check_mountpoint_ready; then + echo "::error ::Mount point /media/volume/MyData not ready after $((max_attempts * 5)) seconds." + exit 1 + fi ssh \ -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null \