Digital Ocean has an API that, among other things, allows DNS changes.
A github user called skibish maintains a small daemon written in go that implements DDNS using this API.
This guide shows you how to make this work on OpenWRT.
Let's say you want the subdomain home.example.org to point to your home router. You can either use Digital Ocean's DNS servers for the entire example.org domain or you can add the following records to your existing DNS server to let Digital Ocean only handle the subdomain: