BCE Inc. says it has signed a deal to buy U.S. fibre internet provider Ziply Fiber for about $5 billion in cash.