Ever since I moved this blog to Netlify I wanted to add a badge to the repository’s README displaying the deploy status. The Shields.io service doesn’t support Netlify badges yet, but luckily I found out that you can build dynamic badges by querying structured data from any public URL.
After digging into the Netlify REST API, I managed to make a badge that fetches all deploys for my site and extracts the status of the last deploy:
[![Deploy status]( )]( )
Which looks like this:
One shortcoming is that you cannot set a different color depending on the status, that’s why I’m using a “neutral” blue background here. Also, I assume deploy logs must be public for the link (and possibly the badge itself) to work.