Swedish fashion group Hennes & Mauritz (H&M) said it will continue to invest and develop its business with a digital focus as its expansion helped to boost sales and earnings in the second quarter.