In the era of the Internet of Things (IoT), conventional cloud-based solutions struggle to handle the huge amount, high velocity, and heterogeneity of data generated at the network edge. In this context, the edge-to-cloud compute continuum has emerged as an effective solution to reduce bandwidth consumption and latency in large-scale applications, through seamless integration of edge computing with cloud services and features. In this chapter, we show how the compute continuum can be effectively leveraged in the context of smart agriculture, with the aim of supporting greenhouse monitoring and management. We also analyze how LSTM neural networks can be integrated into the system to cope with the presence of missing and anomalous sensor data. A thorough experimental evaluation is performed to assess the LSTM performance, also showing how the application deployment at the compute continuum can ensure higher scalability in terms of bandwidth and latency, compared to a conventional cloud-based solution. Our findings show how the joint use of the compute continuum and deep learning can enable the development of a green-aware solution that fosters sustainable and efficient agricultural practices.