Currently there are only two Actions one can create, JS or Docker.
We run everything on a self-hosted linux runner.
I have a custom Docker-image that I use to build. I need to mount specific folders/volumes into this image and also give it the –privileged flag as it is a DinD image.
I have built a workflow that does exactly what I need:
Build: runs-on: self-hosted needs: Cleanup container: image: docker.pkg.github.com/USER/REPO/IMAGE # Using options instead of volumes, due to bug not mounting volumes... # https://github.community/t5/GitHub-Actions/Container-volumes-key-not-mounting-volume/td-p/34798 options: "-v /data/m2:/root/.m2 -v /home/github-runner/.docker:/root/.docker:ro --privileged" steps: - run: /entrypoint.sh
For the workflow, there are the keywords “volumes” and “options” (although volumes does not seem to be functional at the moment). Setting “options” works just as expected.
As we would use this snippet in around 30 Repositories I tried to tidy it a bit by extracting this into an Action, so that the workflow.yml would be much smaller.
The intuitive idea was to create a Docker Action doing this. But Docker Actions are not capable of setting custom Docker options or mounting volumes/folders into the Container. The recommended way around that is to create JS Action that then executes the Docker commands. But isn’t this what a Docker Action should be meant for?
Are there plans to add this feature to the Docker Action?