Earlier quoted context omitted.
I'm not sure if this is the 'right way' or not, but for a recent Go project, I just scripted the build via - name: build run: | docker run --rm -v \ "$PWD":/usr/src/my-project \ -w /usr/src/my-project \ -e GOOS -e GOARCH \ golang:1.13 go build -v -o my-project-$GOOS-$GOARCH env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} (GitHub Actions's build environment already has Docker installed/configured, so there's no…
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 }}
...unless your Dockerfile ends up doing that too? If so I'd be interested to see it if you're willing to share!