Greece avoided another potential brush with bankruptcy after striking a deal with European creditors to tide it over for the rest of the year and gained assurances that its repayment burden will be eased when it finally can stand on its own after nearly a decade on financial life support.