diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6c06dc8..1c8c1f3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,12 +35,12 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build Docker image + - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 - load: true # Load the built image into Docker's local cache + push: true # Push the image instead of loading it locally tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max @@ -54,6 +54,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Log in to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull Docker image for testing + run: | + docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build-image.outputs.image-tags }} + - name: Run Docker container for testing run: | docker run -d -p 8080:8080 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build-image.outputs.image-tags }}