Skip to content

Commit

Permalink
Add Docker build and test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Jan 22, 2024
1 parent 97eb2a8 commit 14c0749
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ jobs:
- name: Print docker image tag
run: |
printf "%s\n" "${DOCKER_IMAGE_TAG}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ env.DOCKER_IMAGE_TAG }}

- name: Test Image
run: |
docker run -it --rm --name nbiatoolkit-test \
-v $(pwd)/:/home/nbiatoolkit/ \
-w /home/nbiatoolkit/ \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ env.DOCKER_IMAGE_TAG }} \
python -c "import nbiatoolkit; print(nbiatoolkit.__version__)"

0 comments on commit 14c0749

Please sign in to comment.