forensics wu+clear repo #5
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
name: Build check on Dockerfiles | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo content | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker Images | |
run: | | |
find . -type f -name "*Dockerfile*" | while read -r dockerfile_path; do | |
echo "==========[ $dockerfile_path ]==========" | |
pushd "$(dirname "$dockerfile_path")" | |
echo "Building image..." | |
docker buildx build --platform linux/amd64 . &> /tmp/docker-build.log | |
build_result=$? | |
if [ $build_result -eq 0 ]; then | |
echo "Build success!" | |
else | |
cat /tmp/docker-build.log | |
rm /tmp/docker-build.log | |
echo "Build failed!" | |
fi | |
popd | |
done |