From e07b6c26fae5950c15243fc96bcd7664aef2664f Mon Sep 17 00:00:00 2001 From: nihaldivyam Date: Mon, 1 Apr 2024 19:44:03 +0530 Subject: [PATCH] test --- .github/workflows/dockerbuild.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 283a1c9..33a3a83 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -42,26 +42,15 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - backup-sealed-secrets-keys/Dockerfile - buildah/Dockerfile - logical-backup/Dockerfile - mongodb-backup/Dockerfile - opensearch-curator/Dockerfile - postgres-cloudnative-citus/Dockerfile + Dockerfile - name: Filter changed Dockerfiles - id: filter-changed-dockerfiles + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - changed_files="${{ steps.changed-files.outputs.all_changed_files }}" - changed_dockerfiles="" - for dockerfile in "${changed_files[@]}"; do - for file in $dockerfile; do - if [[ $file == *"/Dockerfile" ]]; then - changed_dockerfiles="$changed_dockerfiles $file" - fi - done + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" done - echo "::set-output name=changed-dockerfiles::$changed_dockerfiles" - name: Log in to the Container registry uses: docker/login-action@v3 @@ -78,6 +67,7 @@ jobs: - name: Build & push container image id: docker_build + if: ${{ contains(steps.changed-files.outputs.all_changed_files, matrix.dockerfile) }} uses: docker/build-push-action@v5.3.0 with: context: . @@ -85,4 +75,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }} push: true - if: contains(steps.filter-changed-dockerfiles.outputs.changed-dockerfiles, matrix.dockerfile)