From 9f467144923b69f075b4c742ca1e29b643a743b8 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Wed, 4 Dec 2024 11:49:37 +0100 Subject: [PATCH] build: add tests to workflow --- .github/workflows/build-docker-dev.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-dev.yml b/.github/workflows/build-docker-dev.yml index 6c8b5db..a251186 100644 --- a/.github/workflows/build-docker-dev.yml +++ b/.github/workflows/build-docker-dev.yml @@ -1,3 +1,5 @@ +# We first build the image without pushing, then pass some basic init tests, then push + name: Build ai4-papi:dev docker image on: workflow_dispatch @@ -28,12 +30,21 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and push + - name: Build uses: docker/build-push-action@v3 with: context: . - push: true + push: false tags: | ${{ secrets.HARBOR_URL }}/ai4os/ai4-papi:dev ${{ secrets.DOCKERHUB_USERNAME }}/ai4-papi:dev file: docker/Dockerfile + + - name: Tests - Init ai4papi package (dev mode) + run: docker run --rm ${{ secrets.HARBOR_URL }}/ai4os/ai4-papi:dev python3 -c "unset FORWARDED_ALLOW_IPS; import ai4papi" + + - name: Push to Harbor + run: docker push ${{ secrets.HARBOR_URL }}/ai4os/ai4-papi:dev + + - name: Push to Docker Hub + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/ai4-papi:dev