4646 DOCKER_FILE : {{ .Config.GetVariableValue "DOCKERFILE" }}
4747 BUILD_CONTEXT_PATH : {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
4848 NAMESPACE : {{ .Config.GetVariableValue "NAMESPACE" }}
49- RESOURCE_TYPE : {{ .Config.GetVariableValue "RESOURCETYPE" }}
49+ RESOURCE_TYPE : Microsoft.ContainerService/ {{ .Config.GetVariableValue "RESOURCETYPE" }}
5050 RESOURCE_NAME : {{ .Config.GetVariableValue "RESOURCENAME" }}
5151
5252{{`
@@ -97,34 +97,27 @@ jobs:
9797 with :
9898 kubelogin-version : ' v0.0.25'
9999
100- # gets credentials for a fleet
101- - name : Get fleet credentials
102- if : ${{ env.RESOURCE_TYPE == 'fleets' }}
103- run : |
104- az fleet get-credentials -g ${{ env.CLUSTER_RESOURCE_GROUP }} -n ${{ env.RESOURCE_NAME }}
105-
106100 # Retrieves your Azure Kubernetes Service cluster's kubeconfig file
107101 - name : Get K8s context
108- if : ${{ env.RESOURCE_TYPE != 'fleets' }}
109- uses : azure/aks-set-context@v3
102+ uses : azure/aks-set-context@v4.0.2
110103 with :
111104 resource-group : ${{ env.CLUSTER_RESOURCE_GROUP }}
112105 cluster-name : ${{ env.RESOURCE_NAME }}
113106 admin : ' false'
114107 use-kubelogin : ' true'
108+ resource-type : ${{ env.RESOURCE_TYPE }}
115109
116110 # Checks if the AKS cluster is private
117111 - name : Is private cluster
118- if : ${{ env.RESOURCE_TYPE != 'fleets' }}
112+ if : ${{ env.RESOURCE_TYPE != 'Microsoft.ContainerService/ fleets' }}
119113 id : isPrivate
120114 run : |
121115 result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.RESOURCE_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
122116 echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
123117
124118 # Deploys application based on given manifest file
125119 - name : Deploys application
126- if : ${{ env.RESOURCE_TYPE != 'fleets' }}
127- uses : Azure/k8s-deploy@v4
120+ uses : Azure/k8s-deploy@v5.0.1
128121 with :
129122 action : deploy
130123 manifests : ${{ env.DEPLOYMENT_MANIFEST_PATH }}
@@ -134,11 +127,5 @@ jobs:
134127 name : ${{ env.RESOURCE_NAME }}
135128 private-cluster : ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
136129 namespace : ${{ env.NAMESPACE }}
137- - name : Deploys fleet application
138- if : ${{ env.RESOURCE_TYPE == 'fleets' }}
139- run : |
140- kubectl config current-context
141- for manifest in $(echo "${{ env.DEPLOYMENT_MANIFEST_PATH }}" | tr '\n' ' '); do
142- /usr/bin/kubectl apply --validate=false --request-timeout=60s -f ./$manifest --namespace ${{ env.NAMESPACE }}
143- done
130+ resource-type : ${{ env.RESOURCE_TYPE }}
144131` }}
0 commit comments