build: add GitHub Action for pushing to docker hub #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test the Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: docker build -t jljl1337/testpod:test . | |
- name: Run and test the Docker image | |
run: | | |
docker run -d -p 3000:8000 jljl1337/testpod:test | |
sleep 3 | |
curl http://localhost:3000/ | |
curl http://localhost:3000/api | |
docker stop $(docker ps -q) |