Building and pushing docker images to the github container registry

Does anyone know how or if the docker-build-push action can be used with a matrix? I’m trying to set up a workflow to build and push images from multiple directories but can’t get this to work. Thank you.