How to create my own lxd image

I want to create my own lxd image ubuntu and rockey linux and it should have user called sysops with a public key

You can use distrobuilder to do this

Documentation - distrobuilder documentation

Also, instead of starting from scratch with the appropriate configuration file for each images, you can start off with those here.

If you check the Github Actions logs, you can also find the parameters to the configurations.