I spent a couple of hours today working to build my Docker images for ARM and x64 machines in my hosted CI provider, CircleCI. Here is the solution I came up with. I hope this saves you some time if you have to do the same thing in the future.
This solution:
builds ARM and x64 images
runs on commits on the main branch of your repo
pushes your_app:latest and your_app:<1234567> image tags to Docker Hub (where <1234567> are the first 7 characters of the commit SHA)
if the commit is tagged, pushes your_app:<commit_tag> as well