What is the right way for running multiple commands in one action?
I want to run a python script as action.
Before running this script I need to install the requirements.txt.
I can think of several options:
I want to run a script that exists in my repository, then compare 2 files (its output and a file that already exists).
This is a process that includes two commands, whereas in the first example, the pip install command can be considered a building command rather than a test command.
Can I create another Docker for another command, which will contain the output of the previous Docker?
I'm looking for guidelines for the location of the command in Dockerfile, in entrypoint or in args.
Solved! Solved! Go to Solution.
There's not necessarily a "right" or a "wrong" way to make these decisions. My personal opinion on the subjects:
But these are only my personal thoughts on it from my meager experience so far and, much like designing command-line tools, there are a bunch of different ways to achieve the same ends.
You can see how I've designed one Action for a recent project of mine in https://github.com/lee-dohm/generate-elixir-docs. I'll probably move these lines into the Dockerfile eventually, because they can be installed in the image and cached. But this line needs to remain in the `entrypoint.sh` because the definition of the dependencies is stored in the repository itself and may change from one invocation of the Action to the next.
Again, there's no hard and fast right or wrong answer to any of these questions. It mostly depends on how you're intending the Action to be used: only for the one specific project or more generally across multiple projects.
I hope that helps!
I have a publish-to-dockerhub script that is in bash, and I'd prefer to use that for publishing. I don't want to use 2+ different actions. That ties me into the "GitHub Actions" system, and I'd prefer to just set up my environment requirements, and use my script.
Is there a way to do that? I literally just need docker and bash installed in this GH Actions job :)