Hi Edouard, this is a good question. I remember hearing some advice that stuck with me: a developer's skills are not improved simply through the work done on the job. The proven way to improve and expand is through deliberate practice.
It sounds as though you have already found that this is easier said than done!
I have a formula that works for me and it comprises of four main tactics.
I schedule in time for practice and learning sessions just as I would my normal work tasks. I deviate from this schedule as little as possible. For daily practice I like sites such as codewars.
I take longer courses with deadlines and assignments to keep me on track. For example, I've taken Andrew Ng's Machine Learning class which had weekly programming assignments alongside the lectures.
I set distance goals for learning broad new skills and track the progress. E.g.: I want to understand an implementation of Deep Learning by the end of January.
I will periodically review my skills and try to objectively decide where I have weaknesses or gaps in my knowledge.
Building in periodic revision is extremely useful, particularly for skills/topics that you don't use in your daily work. I've taken more than 30 courses this year and some of them have partially evaporated because I haven't taken the time to refresh my memory of the concepts.
Finally, I've found that more than many other disciplines, we require an attitude of "always learning". The moment you decide that you know "enough", or "all of it" is the point you consign yourself to mediocrity. The speed of innovation, the rate of change, the pervasive nature of software systems and the sharing of knowledge; these all contribute to a profession that will never be boring.
I hope this helps, good luck!