Skip to content

MY personal experiments with Docker in GitHub Action

Notifications You must be signed in to change notification settings

PilnyTomas/DockerCI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DockerCI

MY personal experiments with Docker in GitHub Action

I'm a Docker noob, so maybe this is a well known trick, but it was impossible for me to find. Hopefull it will be usefull to others. I found tons of scenarios where they need only to run the Docker in GitHub action, but no files were generated. I found tons of scenarios where they committed files from GitHub action, but no Docker was used. I found tons of scenarios where they pushed commits from Docker, but it wasn't run as GitHub action. I found tons of scenarios where they run remote Docker image, but not the local one generated by GitHub Action. No, ChatGPT doesn't know the answer, it never does. A hint towards my gole found here https://aschmelyun.com/blog/using-docker-run-inside-of-github-actions/

What I want:

  1. User pushes any modification (expected is data.json or perhap update to the script.py)
  2. User reads/downloads files generated by the script.

Why I need all this: A little background explaining why need this strange artistry when a different task could be done differently.

  1. The user is making the modifications on phone - a computer to run the script (which would be a ton easier, yes, I realize that!) is not available.
  2. Installing python intepretter + the packages on the phone is also not desirable. I know it is possible, I just dont want it - it all eats too much disc space AND simple checking out on phone is also not possible via the GitHub app - the user would have to manually download the repo and unzip it to run the script, no thanks!
  3. Running the script directly by the GiuHub action without a Docker - done that, works ok, but slow.

How is it gonna work: From the user point of view

  1. In the GitHub app edit data.json and commit it
  2. Wait few seconds
  3. Read/download or otherwise use the generated files.

From the Github point of view

  1. On push run action which gets cached Docker image (built earlier)
  2. In the docker update files from the repo (COPY)
  3. Run the script to generate the files.
  4. Hand over the new file to the GitHub action
  5. GitHub action commits and pushes the new output files via the GitHubActions profile

About

MY personal experiments with Docker in GitHub Action

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published