Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaldivyam committed Apr 1, 2024
1 parent 5b773a4 commit e07b6c2
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -78,11 +67,11 @@ jobs:

- name: Build & push container image
id: docker_build
if: ${{ contains(steps.changed-files.outputs.all_changed_files, matrix.dockerfile) }}
uses: docker/[email protected]
with:
context: .
file: ${{ matrix.dockerfile }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
if: contains(steps.filter-changed-dockerfiles.outputs.changed-dockerfiles, matrix.dockerfile)

0 comments on commit e07b6c2

Please sign in to comment.