-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nihaldivyam
committed
Apr 1, 2024
1 parent
76a7f57
commit 1d3ef98
Showing
2 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,12 +45,18 @@ jobs: | |
**/Dockerfile | ||
- name: Filter changed Dockerfiles | ||
id: filter-changed-dockerfiles | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
for file in ${ALL_CHANGED_FILES}; do | ||
echo "$file was changed" | ||
done | ||
should_build=false | ||
for dockerfile in ${{ matrix.dockerfile }}; do | ||
if [[ "${ALL_CHANGED_FILES}" == *"${dockerfile}"* ]]; then | ||
should_build=true | ||
break | ||
fi | ||
done | ||
echo "::set-output name=should_build::$should_build" | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
|
@@ -64,10 +70,10 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
images: ${{ matrix.image }} | ||
|
||
- name: Build & push container image | ||
id: docker_build | ||
if: ${{ contains(startsWith(steps.changed-files.outputs.all_changed_files, './'), matrix.dockerfile) }} | ||
if: steps.filter-changed-dockerfiles.outputs.should_build == 'true' | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,4 @@ RUN apt-get clean \ | |
RUN usermod -u 26 postgres | ||
|
||
# Set the user to run subsequent commands as | ||
USER 26 | ||
USER 26 |