PM for GitHub Actions here. I wouldn't suggest that you build an action to run a build within a container. We offer container support for workflow runs which should be suitable for this. (Either by specifying the `jobs.<job-id>.container` or by using `docker run ...`)
Actions themselves are meant to support the workflow and distill a set of complex steps into something that can be done in a single workflow command. (For example, download and set up a new version of a Java JDK.) They're meant to be used as steps in many peoples workflows, instead of executing a single workflow.
The actions themselves can be built as either a container, which is self-contained, or as JavaScript. I often recommend the latter, since that will work cross platform (containers only work for people who are using workflows running on Linux).