Chocolate–along with coffee, beer, wine, avocados, and a long list of other delicious things that that people love–faces risks from climate change. For chocolate manufacturers, like Hershey, that means racing to cut emissions and working to help cocoa farmers adapt to growing their crops in increasing heat and drought. Today, the company announced some of its plans for climate action: They are developing a science-based target to cut emissions, joining the UN Global Compact, and launching a new program in Ghana with cocoa farmers.

“I think everyone recognizes the risk climate change poses to the planet, but for a company like Hershey, with an agricultural supply chain, there’s a risk to our business as well,” says Jeff King, senior director of sustainability, CSR, and social innovation at Hershey. “So we need to be working with the farmers that we depend on to make sure that they are able to adapt to changing conditions and to be doing the right things on the ground to help mitigate the effects of climate change.”

As the world heats up, some areas that grow cocoa could become too hot for the crop, which does best in temperatures below 95 degrees. Cocoa currently only grows in a narrow region of the world near the equator and, by one estimate, the parts of the planet that can grow cocoa could shrink by 30% over the next few decades. Increasing drought is already a challenge, since farmers rely on rain to water their crops.

In Ghana, Hershey is launching a project to both help farmers and protect Kakum National Park, a forest surrounded by cocoa farms. Right now, farmers often cut down trees to plant more cocoa. One challenge is a complicated system for getting formal rights to land; it’s often easier to move into the forest than deal with the government. Hershey is working with the government and other partners to make the process smoother. The company is also helping farmers adopt techniques to grow more cocoa on the same amount of land. “We’ve seen with other programs and experiments that the potential to double yield on an existing farm is not out of the realm of possibilities,” King says.

The program is part of the company’s half-billion-dollar strategy to build a more sustainable cocoa supply chain, which includes ending deforestation, since it recognizes the crucial role that trees play in offsetting the world’s emissions. Hershey is also working with farmers to plant more trees on their farms, since cocoa does best as a shade-grown crop. As cocoa-growing areas in Ghana grow hotter, the shade will protect cocoa trees; the shade trees also help retain water in the soil. The company will also help farmers access financing to plant trees. For smallholder farmers–who produce 60% of the world’s chocolate–it’s the type of program that might help them continue to make a living as the climate changes. Hershey is also helping farmers diversify their farms, adding new crops like cassava, to help give them steadier streams of income.

The company’s supply chain faces risks from climate change for all of its ingredients, from almonds and dairy to sugar. But cocoa is a particular challenge. “We know that there are risks everywhere,” says King. “But when you talk about a particular commodity like cocoa that has a very finite amounts of places on the planet you can grow up from, we believe it is a larger risk, which is why we’re taking these actions now.”

Correction: We’ve updated the photo on this story, as the original one was not of cocoa plants.