Probably deliberate with a lot of incompetence mixed in.
Most politicians have zero understanding of the Internet. They decided to do this as a demonstration of force and may not have consulted the people who built the Great Cannon. Or, the people who built it don't have the clout to say not to use it except for important reasons.
They also probably didn't realize that Github could eat the attack.
The problem with having done this is that, I suspect, that a lot of ISP's now have null routes of China on standby along with bandwidth monitors that will choke traffic spikes from China almost immediately.
So, it didn't actually succeed. And people have now analyzed the attack and deployed coutermeasures.
Not a great result for China.