Skip to content

Commit ad1fa71

Browse files
committed
fixup! refactor: buildx bake matrix target (#59)
1 parent 36dd895 commit ad1fa71

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/CI.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
CR_PAT: ${{ secrets.CR_PAT }}
3838

39-
- name: Build & Test & (Publish) image
39+
- name: Build & Test Images
4040
run: |
4141
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
4242
if [[ "$file" == *"Dockerfile" ]]; then
@@ -59,12 +59,19 @@ jobs:
5959
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-format --version | grep -E "clang-format version $tag"
6060
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-tidy --version | grep "LLVM version $tag"
6161
fi
62+
fi
63+
done
6264
63-
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
64-
echo "start to publish clang-tools:$tag"
65-
docker buildx bake --file docker-bake.hcl --push clang-tools-$tag
66-
fi
67-
else
68-
docker buildx bake --file docker-bake.hcl clang-tools-$tag --print
65+
- name: Publish Images
66+
if: $GITHUB_EVENT_NAME == "push" && github.ref == 'refs/heads/master'
67+
run: |
68+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
69+
if [[ "$file" == *"Dockerfile" ]]; then
70+
tag=`dirname $file`
71+
docker buildx bake --file docker-bake.hcl --push clang-tools-$tag
6972
fi
7073
done
74+
75+
- name: Publish All Images
76+
if: $GITHUB_EVENT_NAME == "workflow_dispatch" && github.ref == 'refs/heads/master'
77+
run: docker buildx bake --file docker-bake.hcl --push clang-tools

0 commit comments

Comments
 (0)