8
8
branches :
9
9
- main
10
10
types : [ opened, synchronize, reopened ]
11
+ workflow_call :
12
+ inputs :
13
+ tag :
14
+ type : string
15
+ required : true
11
16
12
17
permissions :
13
18
contents : read
@@ -26,25 +31,25 @@ jobs:
26
31
- name : Login to Docker Hub
27
32
uses : docker/login-action@v2
28
33
with :
29
- username : ${{ secrets.DOCKERHUB_USERNAME }}
34
+ username : crenshawdotdev
30
35
password : ${{ secrets.DOCKERHUB_PASSWORD }}
31
36
- name : Build and push
32
37
uses : docker/build-push-action@v3
33
38
with :
34
39
context : .
35
40
push : ${{ github.event_name == 'push' }}
36
- tags : crenshawdotdev/argocd-executor-plugin:latest
41
+ tags : crenshawdotdev/argocd-executor-plugin:${{ inputs.tag || ' latest' }}
37
42
- name : Install cosign
38
43
uses : sigstore/cosign-installer@main
39
44
with :
40
45
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
43
48
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 }}
45
50
# Displays the public key to share.
46
51
cosign public-key --key env://COSIGN_PRIVATE_KEY
47
52
env :
48
53
COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
49
54
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