Automation for one button close all light and cover

Hello,

i want to have one button with two actions.
First action will switch all light to off (he on group now) and second action will close cover (all in group now).
Could you help me how to do it?
How the code in automation.yaml is supposed to look?

Regards,
Guy