@@ -32,18 +32,29 @@ jobs:
3232 - name : Set Push Flag
3333 id : set-push
3434 run : |
35- if [[ "${{ github.event_name }}" == "push" && (${{ github.ref == 'refs/heads/main' }} || ${{ startsWith(github.ref, 'refs/tags/') }})]]; then
36- echo "push=true" >> $GITHUB_OUTPUT
37- else
38- echo "push=false" >> $GITHUB_OUTPUT
39- fi
35+ echo "push=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}" >> $GITHUB_OUTPUT
4036
41- - name : Build And Publish Component ${{ matrix.component-name }}
37+ - name : Publish Component ${{ matrix.component-name }}
38+ if : >-
39+ github.repository == 'databendcloud/databend-operator' &&
40+ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
41+ id : publish
4242 uses : ./.github/workflows/template-publish-image
4343 with :
4444 image : ${{ matrix.component-name }}
4545 dockerfile : ${{ matrix.dockerfile }}
4646 platforms : ${{ matrix.platforms }}
4747 context : ${{ matrix.context || '.' }}
48- push : ${{ steps.set-push.outputs.push }}
48+ push : true
49+ github_token : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Test Build for Component ${{ matrix.component-name }}
52+ if : steps.publish.outcome == 'skipped'
53+ uses : ./.github/workflows/template-publish-image
54+ with :
55+ image : ${{ matrix.component-name }}
56+ dockerfile : ${{ matrix.dockerfile }}
57+ platforms : ${{ matrix.platforms }}
58+ context : ${{ matrix.context || '.' }}
59+ push : false
4960 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments