How to Run Multiple Commands in One Github Actions Docker
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...
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:
- Create a
Dockerfilewith the commandRUN pip install -r requirements.txtin it. - Use the
python:3image, and run thepip install -r requirements.txtin theentrypoint.shfile before running the arguments fromargsinmain.workflow. - use both
pip installandpython myscript.pyasargs
Must Read
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.