I used to use Cloudflare's API to do this, but then we changed ISPs and now are behind CGNAT, so we don't even have a public IP. To publicly expose my web server, I created a Cloudflared tunnel, and have our DNS (which is also hosted at Cloudfare) point to the tunnel. It works quite well, and adds some security because we're no longer visible to attackers using IP address scans.