-
What is the right way for running multiple commands in one action? For example: 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:
Another example: 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. the question: 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. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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 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! |
Beta Was this translation helpful? Give feedback.
-
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 :slight_smile: |
Beta Was this translation helpful? Give feedback.
There’s not necessarily a “right” or a “wrong” way to make these decisions. My personal opinion on the subjects:
args
should be used to customize the behavior of an Action from one run to anotherenv
should be used to create named values (that don’t need to be secure) that might be shared between ActionsDOCS_DIR
is, this might be a valid use for an environment variable