From a85d0ebd0aab221d96d9f9aa78b75f2a6b9bdef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Arroba?= <19954079+cesararroba@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:59:05 +0100 Subject: [PATCH] chore(api): test build container image on pull request (#6850) --- .github/workflows/api-pull-request.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/api-pull-request.yml b/.github/workflows/api-pull-request.yml index 01167bfb92..50266327e1 100644 --- a/.github/workflows/api-pull-request.yml +++ b/.github/workflows/api-pull-request.yml @@ -14,7 +14,6 @@ on: paths: - "api/**" - env: POSTGRES_HOST: localhost POSTGRES_PORT: 5432 @@ -26,7 +25,8 @@ env: VALKEY_HOST: localhost VALKEY_PORT: 6379 VALKEY_DB: 0 - + API_WORKING_DIR: ./api + IMAGE_NAME: prowler-api jobs: test: @@ -171,3 +171,17 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: api + test-container-build: + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Container + uses: docker/build-push-action@v6 + with: + context: ${{ env.API_WORKING_DIR }} + push: false + tags: ${{ env.IMAGE_NAME }}:latest + outputs: type=docker + cache-from: type=gha + cache-to: type=gha,mode=max