Both are perfectly correct.
The verb 'like' can be followed by either the gerund or the infinitive. In this case, there is no difference in meaning, but there can be a subtle difference in some cases.
The form with the gerund means that the act itself is enjoyable for me, as in 'I like dancing' or 'I like sleeping late on Sunday mornings'. Meanwhile, the infinitive form can mean that I feel it is a good thing for me to do, as in 'I like to see the dentist every four months' or 'I like to finish my schoolwork before I go out in the evenings.' These are things that you like to do, as a good habit, even though they are not in themselves pleasurable.
This difference was significant until recently, at least in British English. However, because of American influence worldwide, the infinitive form is becoming more common, even in situations where British English would traditionally have used the gerund form.
I hope that is helpful.