Kaissee Burke-Morrison was in possession of £210 worth of the class B drug along with cash and a mobile phone containing incriminating text messages.
Leeds Crown Court heard police officers were on patrol in an unmarked car in the Gipton area of Leeds on September 12, 2020, when they noticed the defendant riding an orange motorbike.
Ashleigh Metcalfe, prosecuting, said Burke-Morrison immediately rode off after seeing the officers and he was followed.
The 22-year-old stopped when the officers told him to.
Ms Metcalfe said the officers spoke to Burke-Morrison and they noticed a strong smell of cannabis.
They told the defendant he was going to be searched when they saw that he appeared to be hiding something in the waistband of his tracksuit bottoms.
He was searched at the roadside and two mobile phones were recovered from his jacket pockets along with £320 in cash.
The bank notes appeared to have been stuffed into his pockets.
Burke-Morrison had a plastic bag in his tracksuit bottoms but he refused to remove it.
He was then handcuffed and told he would be taken to a police station for a further search.
Burke-Morrison then handed the officers the plastic bag.
It contained cannabis worth £210 which had been divided into £30 individual deals.
One of the mobile phones was analysed and found to contain text messages relating to drug supply.
Burke-Morrison, of Bondgate, Harewood, Leeds, pleaded guilty to possessing cannabis with intent to supply.
Probation officer Phil Brown told the court that Burke-Morrison had accepted full responsibility for the offence when interviewed.
Mr Brown said the defendant had been struggling financially and was a single father at the time.
He added: "It was suggested to him that providing cannabis would provide him with an income without having to commit to a full-time job.
"He has had a lot of time since he was arrested to reflect on the poor decision making he has made."
Burke-Morrison was given an eight-month prison sentence, suspended for 18 months.
He was also ordered to do 150 hours of unpaid work.
Sentencing, Judge Rodney Jameson QC said: "For God's sake don't do it again,
"I want to give you the opportunity to put this behind you.
"I want you to understand that if you did anything like this again it would be catastrophic for you."