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 36
36
env :
37
37
CR_PAT : ${{ secrets.CR_PAT }}
38
38
39
- - name : Build & Test & (Publish) image
39
+ - name : Build & Test Images
40
40
run : |
41
41
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
42
42
if [[ "$file" == *"Dockerfile" ]]; then
@@ -59,12 +59,19 @@ jobs:
59
59
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-format --version | grep -E "clang-format version $tag"
60
60
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-tidy --version | grep "LLVM version $tag"
61
61
fi
62
+ fi
63
+ done
62
64
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
69
72
fi
70
73
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