The rapid growth and widespread adoption of cloud computing have led to significant electricity costs and environmental impacts. Traditional approaches that rely on static utilization thresholds are ineffective in dynamic cloud environments, and simply consolidating virtual machines (VMs) to minimize energy costs does not necessarily result in the lowest carbon footprints. In this paper, a deep reinforcement learning (DRL) based framework called CFWS is proposed to enhance the energy efficiency of renewable energy sources (RES) supplied data centers (DCs). CFWS incorporates an adaptive thresholds adjustment method TCN-MAD by evaluating the predicted probability of a physical machine (PM) being overloaded to prevent unnecessary VM migrations and mitigate service level agreement (SLA) violations due to imbalanced workload distribution. Additionally, CFWS introduces a novel action space in the DRL algorithm by representing VM migrations among geo-distributed cloud data centers as flattened indices to accelerate its execution efficiency. Simulation results demonstrate that CFWS can achieve a superior optimization of energy costs and carbon footprints, saving 5.67% to 13.22% brown energy with maximized RES utilization. Furthermore, CFWS reduces VM migrations by up to 86.53% and maintains the lowest SLA violations within suboptimal execution time in comparison to the state-of-art algorithms.