From 0205f7afeb16fdf7e1fb52c6b6b06bc708d4e6b6 Mon Sep 17 00:00:00 2001 From: waja Date: Tue, 7 Oct 2025 22:27:07 +0200 Subject: [PATCH] feat: add CI image test --- .github/workflows/build.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2aae45f..1ccb15b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,12 +62,28 @@ jobs: ${{ env.FULL_VERSION }} ${{ env.MAJOR_VERSION }} - - name: Build and push Docker image - id: build-and-push + - name: Build and export Docker image to Docker + id: build + uses: docker/build-push-action@v2 + with: + load: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:testing + context: . + + - name: Test Docker image + id: test + run: | + docker run -d -p 8888:8888 --name nextcloud --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:testing && \ + docker exec nextcloud occ status && \ + nc -z localhost 8888 + + - name: Push Docker image + id: push + if: github.event_name != 'pull_request' uses: docker/build-push-action@v2 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -75,4 +91,4 @@ jobs: if: ${{ github.event_name != 'pull_request' }} env: COSIGN_EXPERIMENTAL: "true" - run: cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }} + run: cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.push.outputs.digest }}