11---
2- name : ' Reusable: Build and push image'
2+ name : " Reusable: Build and push image"
33
44" on " :
55 workflow_call :
@@ -17,27 +17,32 @@ name: 'Reusable: Build and push image'
1717 type : boolean
1818 default : false
1919 registry :
20- description : ' FQDN of the registry'
20+ description : " FQDN of the registry"
2121 type : string
22- required : true
22+ required : false
23+ default : " "
2324 registry_url :
24- description : ' URL to push image to'
25+ description : " URL to push image to"
2526 type : string
2627 required : false
27- default : ' harbor.puzzle.ch/pitc-ruby-public/ptime/int/rails '
28+ default : " "
2829
2930 secrets :
3031 PUZZLE_REGISTRY_USERNAME :
31- description : ' Needed for the registry login'
32+ description : " Needed for the registry login"
3233 required : true
3334 PUZZLE_REGISTRY_TOKEN :
34- description : ' Needed for the registry login'
35+ description : " Needed for the registry login"
3536 required : true
3637
3738jobs :
3839 build :
3940 environment : ${{ inputs.environment }}
40- runs-on : ' ubuntu-latest'
41+ runs-on : " ubuntu-latest"
42+
43+ env :
44+ BUILD_REGISTRY : ${{ inputs.registry || vars.REGISTRY }}
45+ BUILD_REGISTRY_URL : ${{ inputs.registry_url || vars.REGISTRY_URL }}
4146 steps :
4247 - uses : docker/setup-buildx-action@v3
4348 - uses : docker/login-action@v3
5560 GITHUB_SHA=${{ github.sha }}
5661 target : app
5762 tags : |
58- ${{ inputs.registry_url }}:latest
59- ${{ inputs.registry_url }}:${{ github.sha }}
63+ ${{ vars.REGISTRY_URL }}:latest
64+ ${{ vars.REGISTRY_URL }}:git- ${{ github.sha }}
6065 push : ${{ inputs.push }}
6166 cache-from : type=gha
6267 cache-to : type=gha,mode=max
63- ...
0 commit comments