Search code examples
dockercontinuous-integrationcontinuous-deploymentgithub-actionscontinuous-delivery

Github actions, docker and testing


I have a couple of questions about devops/docker/github actions. I'm pretty new to all of this, seen some full implemented projects but I'm missing some "parts". I'm trying to set up a "complete project" myself, just for exercise/training and getting familiar with everything. For now, I have 3 branches: dev, uat and master. I work on dev (it's the default branch). I create a local branch of the dev branch and push my local changes to that branch. Every time I finish a job (let's say user login functionality), I push this to uat. Some customers get access to the uat server and are able to test these new functionalities. After they accepted the changes, everything from uat goes to master (which is the live server).

So far so good I guess, and if I miss something or there are things I can do better please let me know!

What my questions are:

  1. If I push changes to the dev branch, it should automatically test these changes before I'm able to open a pr to the dev branch, is this possible with Github Actions? Or do I interpret the things I read on the internet wrong?
  2. When things are tested during this push, do I have to spin up a Docker container? Or do I test these things on the ubuntu VM given by Github Actions? What is the best practice? I know there is the possibility to do both, but what is considered best practice?
  3. Does someone has an example? Or a tutorial/blog about this? I'm trying to connect the dots but I'm a little stuck... Cheers and many thanks for the help!

Solution

  • 1 - This video explains it simple and quick

    2 - If you deploy it using docker, test it using docker

    3 - see 1

    Edit: This other video is also a really nice tutorial that uses docker.