I would use only the to- infinitive

Interested in Language
Does this sound right?
"Their goal is giving people motivation to continue working."
I've always felt that when talking about goals, infinitives should be used, as in the following.
"Their goal is to give people motivation to continue working."
Is their a rule for this usage? Do both seem correct to you?
Thanks.
I would use only the to- infinitive
Or Giving people motivation to continue working is their goal.
Thank you guys.