From d72db5748393448d4f9d73f8c33841e9e877fba0 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Thu, 28 Mar 2024 09:54:41 +0100 Subject: [PATCH] Do not build images if there are no changes to Docker sources --- .github/workflows/main.yml | 15 +++++---------- .github/workflows/pre-commit.yml | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cdfc7a3..b83cab4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,11 @@ -name: Build +name: Build images on: push: + paths: + - 'Dockerfile' + - '.dockerignore' + - '.github/workflows/main.yml' schedule: - cron: '12 2 * * MON' @@ -14,18 +18,9 @@ env: IMAGE_REPOSITORY: alfresco-base-java jobs: - pre-commit: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@ba4451e4bd397a963027ba0f7ca4752a27b68689 # v5.21.0 - with: - auto-commit: "true" build: name: Java ${{ matrix.java_major }} on ${{ matrix.base_image.flavor }}:${{ matrix.base_image.major }} runs-on: ubuntu-latest - needs: pre-commit strategy: fail-fast: ${{ github.ref_name == 'master' && false || true }} matrix: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..75a33b3 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: Pre-commit + +on: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@ba4451e4bd397a963027ba0f7ca4752a27b68689 # v5.21.0 + with: + auto-commit: "true"