88 branches :
99 - main
1010 types : [ opened, synchronize, reopened ]
11+ workflow_call :
12+ inputs :
13+ tag :
14+ type : string
15+ required : true
1116
1217permissions :
1318 contents : read
@@ -26,25 +31,25 @@ jobs:
2631 - name : Login to Docker Hub
2732 uses : docker/login-action@v2
2833 with :
29- username : ${{ secrets.DOCKERHUB_USERNAME }}
34+ username : crenshawdotdev
3035 password : ${{ secrets.DOCKERHUB_PASSWORD }}
3136 - name : Build and push
3237 uses : docker/build-push-action@v3
3338 with :
3439 context : .
3540 push : ${{ github.event_name == 'push' }}
36- tags : crenshawdotdev/argocd-executor-plugin:latest
41+ tags : crenshawdotdev/argocd-executor-plugin:${{ inputs.tag || ' latest' }}
3742 - name : Install cosign
3843 uses : sigstore/cosign-installer@main
3944 with :
4045 cosign-release : ' v1.13.0'
41- if : ${{ github.event_name == 'push' }}
42- - name : Sign latest image
46+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
47+ - name : Sign ${{ inputs.tag }} image
4348 run : |
44- cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:latest
49+ cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:${{ inputs.tag }}
4550 # Displays the public key to share.
4651 cosign public-key --key env://COSIGN_PRIVATE_KEY
4752 env :
4853 COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
4954 COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
50- if : ${{ github.event_name == 'push' }}
55+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
0 commit comments