mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-15 10:54:29 -05:00
d17e7459db
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: Pick an Azure region
|
|
description: "Pick an Azure region"
|
|
|
|
inputs:
|
|
attestationVariant:
|
|
description: "Attestation variant to use. Not all regions support all variants."
|
|
required: true
|
|
|
|
outputs:
|
|
region:
|
|
description: "One of the supported Azure regions"
|
|
value: ${{ steps.pick-region.outputs.region }}
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Pick a region
|
|
id: pick-region
|
|
shell: bash
|
|
run: |
|
|
possibleRegionsSNP=(
|
|
"westus"
|
|
"eastus"
|
|
"northeurope"
|
|
"westeurope"
|
|
"southeastasia"
|
|
)
|
|
possibleRegionsTDX=(
|
|
"centralus"
|
|
"eastus2"
|
|
"northeurope"
|
|
"westeurope"
|
|
)
|
|
|
|
if [[ "${{ inputs.attestationVariant }}" == "azure-tdx" ]]; then
|
|
possibleRegions=("${possibleRegionsTDX[@]}")
|
|
else
|
|
possibleRegions=("${possibleRegionsSNP[@]}")
|
|
fi
|
|
|
|
region=${possibleRegions[$RANDOM % ${#possibleRegions[@]}]}
|
|
echo "region=$region" | tee -a "$GITHUB_OUTPUT"
|