Skip to content

Commit 6092f0c

Browse files
AlexFenlonpdabelf5
authored andcommitted
Migrate Azure Storage to Azure Vault
1 parent 0eca36b commit 6092f0c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,15 +542,28 @@ jobs:
542542
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
543543
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
544544

545+
- name: Setup secrets
546+
id: secrets
547+
run: |
548+
echo "Setting secrets for job"
549+
AZURE_STORAGE=$(az keyvault secret show --name azure-storage --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv)
550+
echo "::add-mask::$AZURE_STORAGE"
551+
AZURE_STORAGE_ACCOUNT=$(echo $AZURE_STORAGE | jq -r '.account')
552+
echo "::add-mask::$AZURE_STORAGE_ACCOUNT"
553+
echo "AZURE_STORAGE_ACCOUNT=$AZURE_STORAGE_ACCOUNT" >> $GITHUB_OUTPUT
554+
AZURE_BUCKET_NAME=$(echo $AZURE_STORAGE | jq -r '.bucket')
555+
echo "::add-mask::$AZURE_BUCKET_NAME"
556+
echo "AZURE_BUCKET_NAME=$AZURE_BUCKET_NAME" >> $GITHUB_OUTPUT
557+
545558
- name: Azure Upload Release Packages
546559
uses: azure/CLI@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
547560
with:
548561
inlineScript: |
549562
for i in $(find tarballs -type f); do
550563
echo -n "Uploading ${i} to kubernetes-ingress/v${{ inputs.nic_version }}/${i##*/} ... "
551564
if ${{ ! inputs.dry_run}}; then
552-
az storage blob upload --auth-mode=login -f "$i" -c ${{ secrets.AZURE_BUCKET_NAME }} \
553-
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT }} --overwrite -n kubernetes-ingress/v${{ inputs.nic_version }}/${i##*/}
565+
az storage blob upload --auth-mode=login -f "$i" -c ${{ steps.secrets.outputs.AZURE_BUCKET_NAME }} \
566+
--account-name ${{ steps.secrets.outputs.AZURE_STORAGE_ACCOUNT }} --overwrite -n kubernetes-ingress/v${{ inputs.nic_version }}/${i##*/}
554567
echo "done"
555568
else
556569
echo "skipped, dry_run."

0 commit comments

Comments
 (0)