Call-for-Code-for-Racial-Justice / Legit-Info

"Legit Info" app helps residents understand the impact of legislation and policies based on their country, state, county, city, district location
Apache License 2.0
65 stars 74 forks source link

Add docker build run GitHub action #120

Closed upkarlidder closed 2 years ago

upkarlidder commented 2 years ago

Background on the problem the feature will solve/improved user experience

The code does not run any container tests on push.

Describe the solution you'd like

Example:

https://github.com/Pyrrha-Platform/Pyrrha-Rules-Decision/blob/main/.github/workflows/docker-build-test.yml

Tasks

N/A

Acceptance Criteria

A push and PR should invoke the docker-build-run GitHub action.

ozer550 commented 2 years ago

Hi, I would like to work on this issue can someone guide me further?

upkarlidder commented 2 years ago

@ozer619 pls look at

https://github.com/Pyrrha-Platform/Pyrrha-Rules-Decision/blob/main/.github/workflows/docker-build-test.yml

We would like a similar action for this project. I am happy to assist.

You can use this dockerfile: https://github.com/Call-for-Code-for-Racial-Justice/Legit-Info/blob/main/Dockerfile

ozer550 commented 2 years ago

Thank you @upkarlidder for the resources, I have worked with GitHub actions but am new to Docker, https://github.com/Pyrrha-Platform/Pyrrha-Rules-Decision/blob/main/.github/workflows/docker-build-test.yml the actions of this file seem to be a little cryptic for me. Can you guide me on how do we build the docker for this repo?

ozer550 commented 2 years ago
 docker run --rm --name rulesdecision-test -d rulesdecision
          sleep 5
          STATUS_CODE=$(docker exec rulesdecision-test curl -s -o /dev/null -w "%{http_code}" localhost:8080/health)
          docker stop rulesdecision-test
          echo $STATUS_CODE | grep -q 200

how do I edit this piece of code for our repo

demilolu commented 2 years ago

@upkarlidder @tonypearson ^^ fyi

upkarlidder commented 2 years ago

Fixed in #122.