Skip to content

Commit 4337040

Browse files
committed
Pull Plus cert/key from Azure Vault
1 parent eb0bb19 commit 4337040

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/build-base-images.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,40 @@ jobs:
122122
- name: Checkout Repository
123123
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
124124

125+
- name: Azure login
126+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
127+
with:
128+
client-id: ${{ secrets.AZURE_VAULT_CLIENT_ID }}
129+
tenant-id: ${{ secrets.AZURE_VAULT_TENANT_ID }}
130+
subscription-id: ${{ secrets.AZURE_VAULT_SUBSCRIPTION_ID }}
131+
132+
- name: Setup secrets
133+
id: secrets
134+
run: |
135+
echo "Setting secrets for job"
136+
PLUS_CREDS=$(az keyvault secret show --name plus-creds --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv)
137+
echo "::add-mask::$PLUS_CREDS"
138+
IFS=@ cert=$(echo $PLUS_CREDS | jq -r '.crt')
139+
{
140+
echo 'PLUS_CERT<<EOF'
141+
echo $cert
142+
echo 'EOF'
143+
} >> "$GITHUB_OUTPUT"
144+
while read -r line;
145+
do
146+
echo "::add-mask::${line}"
147+
done <<< "${PLUS_CERT}"
148+
IFS=@ key=$(echo $PLUS_CREDS | jq -r '.key')
149+
{
150+
echo 'PLUS_KEY<<EOF'
151+
echo $key
152+
echo 'EOF'
153+
} >> "$GITHUB_OUTPUT"
154+
while read -r line;
155+
do
156+
echo "::add-mask::${line}"
157+
done <<< "${PLUS_KEY}"
158+
125159
- name: Docker Buildx
126160
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
127161

@@ -172,8 +206,8 @@ jobs:
172206
BUILD_OS=${{ matrix.image }}
173207
IC_VERSION=${{ needs.checks.outputs.ic_version }}
174208
secrets: |
175-
"nginx-repo.crt=${{ secrets.NGINX_CRT }}"
176-
"nginx-repo.key=${{ secrets.NGINX_KEY }}"
209+
"nginx-repo.crt=${{ steps.secrets.outputs.PLUS_CERT }}"
210+
"nginx-repo.key=${{ steps.secrets.outputs.PLUS_KEY }}"
177211
178212
build-plus-nap:
179213
name: Build Plus NAP base images

0 commit comments

Comments
 (0)