I've recently created a GitHub Action using docker: https://github.com/vidavidorra/github-action-renovate
Where I use this action, I see in the logs that it is buiding the action, rather than pulling it like I see with other actions. For example see this build log, where the action is being buit. In the log of an 3rd party action I see that it is pulling the image.
Why is my action not being pulled, but built every time? I see that the time penalty is about 1 minute with the pulled action vs buidling. I searched the docs, but couldn't find information on it. Do I need to push the image to Docker Hub in order to be able to pull the image? If so, does GitHub Actions automatically detect that it can pull the image and doesn't need to build it?
Solved! Solved! Go to Solution.
Hi @jdbruijn ,
I checked wagoid/commitlint-github-action. In its action.yml , the author specific a docker image in dockerhub under runs key. When using this action in a workflow, it will pull the image from dockerhub.
runs: using: 'docker' image: 'docker://wagoid/commitlint-github-action:1.6.0'
And in your action.yml , you are using Dockerfile. When using this action in a workflow, it will build the image using the Dockerfile.
runs: using: docker image: src/Dockerfile
If you want to pull image instead of build when using your Docker action , I would recommend you push the image into Dockerhub and then modify your action.yml > runs > image using an image instead of Dockerfile.
I see, thanks for the explanation!
I'll have a look then whether I want to setup Docker build and push in my workflow. Would make it a bit more complex since I'd have to build that before I can test the action, and then also would have to update my action.yml based on that build. And I want to do all that automatically in my workflow :)
The docker build and push wouldn't be such an issue, but the updating of action.yml would probably be since I also run self-tests in my action.
Anyways, I'll have to look into all that further. Thanks for the answer!