Check the voltage across the battery when the bike is running at 6500k, you should have 14v if so the charging system is fine. Hopefully what you've got is a badly discharged battery in which case you just need to replace it.
I'd also suggest you look into how this has happened, or it very possible it will just happen again. One of the biggest causes is cheap batteries, some mainly Chinese ones are just crap, especially gel types, OE spec (Yuasa) is around £80 odd, you can get a Chinese rip off for as low as £20 odd and everything in between. They aren't in most cases apples for apples either OE is 11Ah and 230v ish, cheaper are 9Ah and 150v ish, the latter will not last.
It's up to you but as with everything you get what you pay for, my advice go for OE, or if you're on a budget something like Varta. As you found out and just got away with it, they fail without warning luckily you made it home, had you not you'd be looking at recovery and all the potential cost and inconvenience that goes with it.
Fingers crossed just a naff battery