File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments