1818# 2. Set the following environment variables (or replace the values below):
1919# - ACR_RESOURCE_GROUP (resource group of your ACR)
2020# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
21+ # - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2122# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
2223# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedCluster')
2324# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
2425# - DEPLOYMENT_MANIFEST_PATH (path to the manifest yaml for your deployment)
2526# - DOCKER_FILE (path to your Dockerfile)
2627# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728# - NAMESPACE (namespace to deploy your application)
28- # - RESOURCE_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2929# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
3030# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
3131# For more options with the actions used below please refer to https://github.com/Azure/login
4141 ACR_RESOURCE_GROUP : {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }}
4242 AZURE_CONTAINER_REGISTRY : {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }}
4343 CONTAINER_NAME : {{ .Config.GetVariableValue "CONTAINERNAME" }}
44+ CLUSTER_NAME : {{ .Config.GetVariableValue "CLUSTERNAME" }}
4445 CLUSTER_RESOURCE_GROUP : {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
45- CLUSTER_RESOURCE_TYPE : Microsoft.ContainerService/{{ .Config.GetVariableValue "RESOURCETYPE " }}
46+ CLUSTER_RESOURCE_TYPE : Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE " }}
4647 DEPLOYMENT_MANIFEST_PATH : {{ .Config.GetVariableValue "DEPLOYMENTMANIFESTPATH" }}
4748 DOCKER_FILE : {{ .Config.GetVariableValue "DOCKERFILE" }}
4849 BUILD_CONTEXT_PATH : {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
4950 NAMESPACE : {{ .Config.GetVariableValue "NAMESPACE" }}
50- RESOURCE_NAME : {{ .Config.GetVariableValue "RESOURCENAME" }}
5151{{`
5252jobs :
5353 buildImage :
@@ -101,7 +101,7 @@ jobs:
101101102102 with :
103103 resource-group : ${{ env.CLUSTER_RESOURCE_GROUP }}
104- cluster-name : ${{ env.RESOURCE_NAME }}
104+ cluster-name : ${{ env.CLUSTER_NAME }}
105105 admin : ' false'
106106 use-kubelogin : ' true'
107107 resource-type : ${{ env.CLUSTER_RESOURCE_TYPE }}
@@ -111,7 +111,7 @@ jobs:
111111 if : ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
112112 id : isPrivate
113113 run : |
114- result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.RESOURCE_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
114+ result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
115115 echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
116116
117117 # Deploys application based on given manifest file
@@ -123,7 +123,7 @@ jobs:
123123 images : |
124124 ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
125125 resource-group : ${{ env.CLUSTER_RESOURCE_GROUP }}
126- name : ${{ env.RESOURCE_NAME }}
126+ name : ${{ env.CLUSTER_NAME }}
127127 private-cluster : ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
128128 namespace : ${{ env.NAMESPACE }}
129129 resource-type : ${{ env.CLUSTER_RESOURCE_TYPE }}
0 commit comments