I like this approach as well, though I typically include a `Dockerfile` in my Go projects so my run task is just:
- name: Build
run: docker build -t me/image:latest .
env:
DOCKER_BUILDKIT: 1
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}