6363 ref : ${{ inputs.branch }}
6464 fetch-depth : 0
6565
66+ - name : Azure login
67+ uses : azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
68+ with :
69+ client-id : ${{ secrets.AZURE_VAULT_CLIENT_ID }}
70+ tenant-id : ${{ secrets.AZURE_VAULT_TENANT_ID }}
71+ subscription-id : ${{ secrets.AZURE_VAULT_SUBSCRIPTION_ID }}
72+ if : ${{ inputs.authenticated }}
73+
74+ - name : Setup secrets
75+ id : secrets
76+ run : |
77+ echo "Setting secrets for job"
78+ PLUS_CREDS=$(az keyvault secret show --name plus-creds --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv)
79+ echo "::add-mask::$PLUS_CREDS"
80+ echo $PLUS_CREDS | jq -r '.crt' > nginx-repo.crt
81+ echo $PLUS_CREDS | jq -r '.key' > nginx-repo.key
82+ if : ${{ inputs.authenticated }}
83+
6684 - name : Authenticate to Google Cloud
6785 id : auth
6886 uses : google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
@@ -154,9 +172,10 @@ jobs:
154172 BUILD_OS=${{ inputs.image }}
155173 IC_VERSION=${{ inputs.ic-version && inputs.ic-version || steps.meta.outputs.version }}
156174 ${{ inputs.nap-modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.name) || '' }}
175+ secret-files : |
176+ nginx-repo.crt=nginx-repo.crt
177+ nginx-repo.key=nginx-repo.key
157178 secrets : |
158- "nginx-repo.crt=${{ inputs.nap-modules != '' && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
159- "nginx-repo.key=${{ inputs.nap-modules != '' && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
160179 ${{ inputs.nap-modules != '' && contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
161180 if : ${{ inputs.authenticated && steps.images_exist.outputs.base_exists != 'true' }}
162181
@@ -199,9 +218,10 @@ jobs:
199218 IC_VERSION=${{ inputs.ic-version && inputs.ic-version || steps.meta.outputs.version }}
200219 ${{ inputs.nap-modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.name) || '' }}
201220 ${{ (contains(inputs.target, 'aws') && inputs.nap-modules != '') && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }}
221+ secret-files : |
222+ nginx-repo.crt=nginx-repo.crt
223+ nginx-repo.key=nginx-repo.key
202224 secrets : |
203- "nginx-repo.crt=${{ inputs.nap-modules != '' && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
204- "nginx-repo.key=${{ inputs.nap-modules != '' && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
205225 ${{ contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
206226 if : ${{ steps.images_exist.outputs.base_exists != 'true' || steps.images_exist.outputs.target_exists != 'true' }}
207227
@@ -222,3 +242,8 @@ jobs:
222242 github-token : ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
223243 summary : true
224244 if : ${{ inputs.authenticated && steps.build-push.conclusion == 'success' }}
245+
246+ - name : Clean up secrets
247+ run : |
248+ rm -f nginx-repo.crt nginx-repo.key
249+ if : always()
0 commit comments